(function (factory) {
    typeof define === 'function' && define.amd ? define(factory) :
    factory();
}((function () { 'use strict';

    class Fake{
        //fake class as fallback
    }

    class FakeCore{
        //fake class as fallback
    }

    class Is{
        constructor(strict=true){
            this.strict=strict;
        }

        //core
        throw(valueType,expectedType){
            let err=new TypeError;
            err.message=`expected type of ${valueType} to be ${expectedType}`;
            if(!this.strict){
                return false;
            }
            throw err;
        }

        typeCheck(value,type){
            if(typeof value === type){
                return true;
            }
            return this.throw(typeof value,type);
        }

        instanceCheck(value=new Fake, constructor=FakeCore){
            //console.log(value,constructor);
            if(value instanceof constructor){
                return true;
            }
            return this.throw(typeof value,constructor.name);
        }

        symbolStringCheck(value,type){
            if(Object.prototype.toString.call(value) == `[object ${type}]`){
                return true;
            }
            return this.throw(Object.prototype.toString.call(value),`[object ${type}]`);
        }

        compare(value,targetValue,typeName){
            if(value==targetValue){
                return true;
            }
            return this.throw(typeof value, typeName);
        }

        //unique checks
        finite(value){
            if(isFinite(value)){
                return true;
            }
            return this.throw(typeof value, 'finite');
        }

        NaN(value){
            if(!this.number(value)){
                return this.number(value);
            }

            if(isNaN(value)){
                return true;
            }

            return this.throw(typeof value, 'NaN');
        }

        null(value){
            return this.compare(value,null,'null');
        }

        //common sugar
        array(value){
            return this.instanceCheck(value,Array);
        }

        boolean(value){
            return this.typeCheck(value,'boolean');
        }

        bigint(value){
            return this.typeCheck(value,'bigint');
        }

        date(value){
            return this.instanceCheck(value,Date);
        }
        
        generator(value){
            return this.symbolStringCheck(value,'Generator');
        }

        asyncGenerator(value){
            return this.symbolStringCheck(value,'AsyncGenerator');
        }

        globalThis(value){
            return this.compare(value,globalThis,'explicitly globalThis, not window, global nor self');
        }

        infinity(value){
            return this.compare(value,Infinity,'Infinity');
        }

        map(value){
            return this.instanceCheck(value,Map);
        }

        weakMap(value){
            return this.instanceCheck(value,WeakMap);
        }

        number(value){
            return this.typeCheck(value,'number');
        }

        object(value){
            return this.typeCheck(value,'object');
        }

        promise(value){
            return this.instanceCheck(value,Promise);
        }

        regExp(value){
            return this.instanceCheck(value,RegExp);
        }
        
        undefined(value){
            return this.typeCheck(value,'undefined');
        }

        set(value){
            return this.instanceCheck(value,Set);
        }

        weakSet(value){
            return this.instanceCheck(value,WeakSet);
        }
        
        string(value){
            return this.typeCheck(value,'string');
        }

        symbol(value){
            return this.typeCheck(value,'symbol');
        }

        //functions
        function(value){
            return this.typeCheck(value,'function');
        }

        asyncFunction(value){
            return this.symbolStringCheck(value,'AsyncFunction');
        }

        generatorFunction(value){
            return this.symbolStringCheck(value,'GeneratorFunction');
        }

        asyncGeneratorFunction(value){
            return this.symbolStringCheck(value,'AsyncGeneratorFunction');
        }

        //error sugar
        error(value){
            return this.instanceCheck(value,Error);
        }

        evalError(value){
            return this.instanceCheck(value,EvalError);
        }

        rangeError(value){
            return this.instanceCheck(value,RangeError);
        }

        referenceError(value){
            return this.instanceCheck(value,ReferenceError);
        }

        syntaxError(value){
            return this.instanceCheck(value,SyntaxError);
        }

        typeError(value){
            return this.instanceCheck(value,TypeError);
        }

        URIError(value){
            return this.instanceCheck(value,URIError);
        }    

        //typed array sugar
        bigInt64Array(value){
            return this.instanceCheck(value,BigInt64Array);
        }

        bigUint64Array(value){
            return this.instanceCheck(value,BigUint64Array);
        }

        float32Array(value){
            return this.instanceCheck(value,Float32Array);
        }

        float64Array(value){
            return this.instanceCheck(value,Float64Array);
        }

        int8Array(value){
            return this.instanceCheck(value,Int8Array);
        }

        int16Array(value){
            return this.instanceCheck(value,Int16Array);
        }

        int32Array(value){
            return this.instanceCheck(value,Int32Array);
        }

        uint8Array(value){
            return this.instanceCheck(value,Uint8Array);
        }

        uint8ClampedArray(value){
            return this.instanceCheck(value,Uint8ClampedArray);
        }
        
        uint16Array(value){
            return this.instanceCheck(value,Uint16Array);
        }

        uint32Array(value){
            return this.instanceCheck(value,Uint32Array);
        }

        //buffers
        arrayBuffer(value){
            return this.instanceCheck(value,ArrayBuffer);
        }

        dataView(value){
            return this.instanceCheck(value,DataView);
        }

        sharedArrayBuffer(value){
            return this.instanceCheck(value,(function(){try{return SharedArrayBuffer}catch{ return Fake}})());
        }

        //Intl (browser internationalization)
        intlDateTimeFormat(value){
            return this.instanceCheck(value,Intl.DateTimeFormat);
        }

        intlCollator(value){
            return this.instanceCheck(value,Intl.Collator);
        }

        intlDisplayNames(value){
            return this.instanceCheck(value,Intl.DisplayNames);
        }

        intlListFormat(value){
            return this.instanceCheck(value,Intl.ListFormat);
        }

        intlLocale(value){
            return this.instanceCheck(value,Intl.Locale);
        }

        intlNumberFormat(value){
            return this.instanceCheck(value,Intl.NumberFormat);
        }

        intlPluralRules(value){
            return this.instanceCheck(value,Intl.PluralRules);
        }

        intlRelativeTimeFormat(value){
            return this.instanceCheck(value,Intl.RelativeTimeFormat);
        }

        intlRelativeTimeFormat(value){
            return this.instanceCheck(value,Intl.RelativeTimeFormat);
        }



        //garbage collection
        finalizationRegistry(value){
            return this.instanceCheck(value,FinalizationRegistry);
        }

        weakRef(value){
            return this.instanceCheck(value,WeakRef);
        }
    }

    const is = new Is();
    class EventPubSub {
      constructor() {
        this.handleOnce = (type, handlers, ...args) => {
          is.string(type);
          is.array(handlers);
          const deleteOnceHandled = [];
          for (let handler of handlers) {
            handler(...args);
            if (handler[this.once]) {
              deleteOnceHandled.push(handler);
            }
          }
          for (let handler of deleteOnceHandled) {
            this.off(type, handler);
          }
        };
        this.all = Symbol.for("event-pubsub-all");
        this.once = Symbol.for("event-pubsub-once");
        this.events = {};
      }
      on(type, handler, once = false) {
        is.string(type);
        is.function(handler);
        is.boolean(once);
        if (type == "*") {
          type = this.all;
        }
        if (!this.events[type]) {
          this.events[type] = [];
        }
        handler[this.once] = once;
        this.events[type].push(handler);
        return this;
      }
      once(type, handler) {
        return this.on(type, handler, true);
      }
      off(type = "*", handler = "*") {
        is.string(type);
        if (type == this.all.toString() || type == "*") {
          type = this.all;
        }
        if (!this.events[type]) {
          return this;
        }
        if (handler == "*") {
          delete this.events[type];
          return this;
        }
        is.function(handler);
        const handlers = this.events[type];
        while (handlers.includes(handler)) {
          handlers.splice(handlers.indexOf(handler), 1);
        }
        if (handlers.length < 1) {
          delete this.events[type];
        }
        return this;
      }
      emit(type, ...args) {
        is.string(type);
        const globalHandlers = this.events[this.all] || [];
        this.handleOnce(this.all.toString(), globalHandlers, type, ...args);
        if (!this.events[type]) {
          return this;
        }
        const handlers = this.events[type];
        this.handleOnce(type, handlers, ...args);
        return this;
      }
      reset() {
        this.off(this.all.toString());
        for (let type in this.events) {
          this.off(type);
        }
        return this;
      }
      get list() {
        return Object.assign({}, this.events);
      }
    }

    class PlayEvent extends EventPubSub {
      constructor() {
        super();
      }
    }
    var events2 = new PlayEvent();

    var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};

    function createCommonjsModule(fn) {
      var module = { exports: {} };
    	return fn(module, module.exports), module.exports;
    }

    function commonjsRequire (target) {
    	throw new Error('Could not dynamically require "' + target + '". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.');
    }

    /**
     * mux.js
     *
     * Copyright (c) Brightcove
     * Licensed Apache-2.0 https://github.com/videojs/mux.js/blob/master/LICENSE
     */

    var mux_min = createCommonjsModule(function (module, exports) {
    !function(t){module.exports=t();}(function(){return function(){function t(e,i,n){function a(s,o){if(!i[s]){if(!e[s]){var d="function"==typeof commonjsRequire&&commonjsRequire;if(!o&&d)return d(s,!0);if(r)return r(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var p=i[s]={exports:{}};e[s][0].call(p.exports,function(t){return a(e[s][1][t]||t)},p,p.exports,t,e,i,n);}return i[s].exports}for(var r="function"==typeof commonjsRequire&&commonjsRequire,s=0;s<n.length;s++)a(n[s]);return a}return t}()({1:[function(t,e,i){var n,a=t(49),r=t(2);n=function(){var t=new Uint8Array,e=0;n.prototype.init.call(this),this.setTimestamp=function(t){e=t;},this.push=function(i){var n,a,s,o,d=0,h=0;for(t.length?(o=t.length,t=new Uint8Array(i.byteLength+o),t.set(t.subarray(0,o)),t.set(i,o)):t=i;t.length-h>=3;)if(t[h]!=="I".charCodeAt(0)||t[h+1]!=="D".charCodeAt(0)||t[h+2]!=="3".charCodeAt(0))if(255!=(255&t[h])||240!=(240&t[h+1]))h++;else {if(t.length-h<7)break;if(d=r.parseAdtsSize(t,h),h+d>t.length)break;s={type:"audio",data:t.subarray(h,h+d),pts:e,dts:e},this.trigger("data",s),h+=d;}else {if(t.length-h<10)break;if(d=r.parseId3TagSize(t,h),h+d>t.length)break;a={type:"timed-metadata",data:t.subarray(h,h+d)},this.trigger("data",a),h+=d;}n=t.length-h,t=n>0?t.subarray(h):new Uint8Array;},this.reset=function(){t=new Uint8Array,this.trigger("reset");},this.endTimeline=function(){t=new Uint8Array,this.trigger("endedtimeline");};},n.prototype=new a,e.exports=n;},{2:2,49:49}],2:[function(t,e,i){var n=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],a=function(t,e){var i=t[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9],n=t[e+5],a=(16&n)>>4;return i=i>=0?i:0,a?i+20:i+10},r=function(t,e){return t.length-e<10||t[e]!=="I".charCodeAt(0)||t[e+1]!=="D".charCodeAt(0)||t[e+2]!=="3".charCodeAt(0)?e:(e+=a(t,e),r(t,e))},s=function(t){var e=r(t,0);return t.length>=e+2&&255==(255&t[e])&&240==(240&t[e+1])&&16==(22&t[e+1])},o=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},d=function(t,e,i){var n,a="";for(n=e;n<i;n++)a+="%"+("00"+t[n].toString(16)).slice(-2);return a},h=function(t,e,i){return unescape(d(t,e,i))},p=function(t,e){var i=(224&t[e+5])>>5,n=t[e+4]<<3;return 6144&t[e+3]|n|i},u=function(t,e){return t[e]==="I".charCodeAt(0)&&t[e+1]==="D".charCodeAt(0)&&t[e+2]==="3".charCodeAt(0)?"timed-metadata":!0&t[e]&&240==(240&t[e+1])?"audio":null},c=function(t){for(var e=0;e+5<t.length;){if(255===t[e]&&240==(246&t[e+1]))return n[(60&t[e+2])>>>2];e++;}return null},l=function(t){var e,i,n;e=10,64&t[5]&&(e+=4,e+=o(t.subarray(10,14)));do{if((i=o(t.subarray(e+4,e+8)))<1)return null;if("PRIV"===String.fromCharCode(t[e],t[e+1],t[e+2],t[e+3])){n=t.subarray(e+10,e+i+10);for(var a=0;a<n.byteLength;a++)if(0===n[a]){var r=h(n,0,a);if("com.apple.streaming.transportStreamTimestamp"===r){var s=n.subarray(a+1),d=(1&s[3])<<30|s[4]<<22|s[5]<<14|s[6]<<6|s[7]>>>2;return d*=4,d+=3&s[7]}break}}e+=10,e+=i;}while(e<t.byteLength);return null};e.exports={isLikelyAacData:s,parseId3TagSize:a,parseAdtsSize:p,parseType:u,parseSampleRate:c,parseAacTimestamp:l};},{}],3:[function(t,e,i){var n,a=t(49),r=t(47).ONE_SECOND_IN_TS,s=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];n=function(t){var e,i=0;n.prototype.init.call(this),this.push=function(n){var a,o,d,h,p,u,c=0;if(t||(i=0),"audio"===n.type)for(e?(h=e,e=new Uint8Array(h.byteLength+n.data.byteLength),e.set(h),e.set(n.data,h.byteLength)):e=n.data;c+5<e.length;)if(255===e[c]&&240==(246&e[c+1])){if(o=2*(1&~e[c+1]),a=(3&e[c+3])<<11|e[c+4]<<3|(224&e[c+5])>>5,p=1024*(1+(3&e[c+6])),u=p*r/s[(60&e[c+2])>>>2],d=c+a,e.byteLength<d)return;if(this.trigger("data",{pts:n.pts+i*u,dts:n.dts+i*u,sampleCount:p,audioobjecttype:1+(e[c+2]>>>6&3),channelcount:(1&e[c+2])<<2|(192&e[c+3])>>>6,samplerate:s[(60&e[c+2])>>>2],samplingfrequencyindex:(60&e[c+2])>>>2,samplesize:16,data:e.subarray(c+7+o,d)}),i++,e.byteLength===d)return void(e=void 0);e=e.subarray(d);}else c++;},this.flush=function(){i=0,this.trigger("done");},this.reset=function(){e=void 0,this.trigger("reset");},this.endTimeline=function(){e=void 0,this.trigger("endedtimeline");};},n.prototype=new a,e.exports=n;},{47:47,49:49}],4:[function(t,e,i){var n,a,r,s=t(49),o=t(48);a=function(){var t,e,i=0;a.prototype.init.call(this),this.push=function(n){var a;e?(a=new Uint8Array(e.byteLength+n.data.byteLength),a.set(e),a.set(n.data,e.byteLength),e=a):e=n.data;for(var r=e.byteLength;i<r-3;i++)if(1===e[i+2]){t=i+5;break}for(;t<r;)switch(e[t]){case 0:if(0!==e[t-1]){t+=2;break}if(0!==e[t-2]){t++;break}i+3!==t-2&&this.trigger("data",e.subarray(i+3,t-2));do{t++;}while(1!==e[t]&&t<r);i=t-2,t+=3;break;case 1:if(0!==e[t-1]||0!==e[t-2]){t+=3;break}this.trigger("data",e.subarray(i+3,t-2)),i=t-2,t+=3;break;default:t+=3;}e=e.subarray(i),t-=i,i=0;},this.reset=function(){e=null,i=0,this.trigger("reset");},this.flush=function(){e&&e.byteLength>3&&this.trigger("data",e.subarray(i+3)),e=null,i=0,this.trigger("done");},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline");};},a.prototype=new s,r={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},n=function(){var t,e,i,s,d,h,p,u=new a;n.prototype.init.call(this),t=this,this.push=function(t){"video"===t.type&&(e=t.trackId,i=t.pts,s=t.dts,u.push(t));},u.on("data",function(n){var a={trackId:e,pts:i,dts:s,data:n};switch(31&n[0]){case 5:a.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:a.nalUnitType="sei_rbsp",a.escapedRBSP=d(n.subarray(1));break;case 7:a.nalUnitType="seq_parameter_set_rbsp",a.escapedRBSP=d(n.subarray(1)),a.config=h(a.escapedRBSP);break;case 8:a.nalUnitType="pic_parameter_set_rbsp";break;case 9:a.nalUnitType="access_unit_delimiter_rbsp";}t.trigger("data",a);}),u.on("done",function(){t.trigger("done");}),u.on("partialdone",function(){t.trigger("partialdone");}),u.on("reset",function(){t.trigger("reset");}),u.on("endedtimeline",function(){t.trigger("endedtimeline");}),this.flush=function(){u.flush();},this.partialFlush=function(){u.partialFlush();},this.reset=function(){u.reset();},this.endTimeline=function(){u.endTimeline();},p=function(t,e){var i,n,a=8,r=8;for(i=0;i<t;i++)0!==r&&(n=e.readExpGolomb(),r=(a+n+256)%256),a=0===r?a:r;},d=function(t){for(var e,i,n=t.byteLength,a=[],r=1;r<n-2;)0===t[r]&&0===t[r+1]&&3===t[r+2]?(a.push(r+2),r+=2):r++;if(0===a.length)return t;e=n-a.length,i=new Uint8Array(e);var s=0;for(r=0;r<e;s++,r++)s===a[0]&&(s++,a.shift()),i[r]=t[s];return i},h=function(t){var e,i,n,a,s,d,h,u,c,l,f,m,g,y=0,b=0,v=0,S=0,T=1;if(e=new o(t),i=e.readUnsignedByte(),a=e.readUnsignedByte(),n=e.readUnsignedByte(),e.skipUnsignedExpGolomb(),r[i]&&(s=e.readUnsignedExpGolomb(),3===s&&e.skipBits(1),e.skipUnsignedExpGolomb(),e.skipUnsignedExpGolomb(),e.skipBits(1),e.readBoolean()))for(f=3!==s?8:12,g=0;g<f;g++)e.readBoolean()&&(g<6?p(16,e):p(64,e));if(e.skipUnsignedExpGolomb(),0===(d=e.readUnsignedExpGolomb()))e.readUnsignedExpGolomb();else if(1===d)for(e.skipBits(1),e.skipExpGolomb(),e.skipExpGolomb(),h=e.readUnsignedExpGolomb(),g=0;g<h;g++)e.skipExpGolomb();if(e.skipUnsignedExpGolomb(),e.skipBits(1),u=e.readUnsignedExpGolomb(),c=e.readUnsignedExpGolomb(),l=e.readBits(1),0===l&&e.skipBits(1),e.skipBits(1),e.readBoolean()&&(y=e.readUnsignedExpGolomb(),b=e.readUnsignedExpGolomb(),v=e.readUnsignedExpGolomb(),S=e.readUnsignedExpGolomb()),e.readBoolean()&&e.readBoolean()){switch(e.readUnsignedByte()){case 1:m=[1,1];break;case 2:m=[12,11];break;case 3:m=[10,11];break;case 4:m=[16,11];break;case 5:m=[40,33];break;case 6:m=[24,11];break;case 7:m=[20,11];break;case 8:m=[32,11];break;case 9:m=[80,33];break;case 10:m=[18,11];break;case 11:m=[15,11];break;case 12:m=[64,33];break;case 13:m=[160,99];break;case 14:m=[4,3];break;case 15:m=[3,2];break;case 16:m=[2,1];break;case 255:m=[e.readUnsignedByte()<<8|e.readUnsignedByte(),e.readUnsignedByte()<<8|e.readUnsignedByte()];}m&&(T=m[0]/m[1]);}return {profileIdc:i,levelIdc:n,profileCompatibility:a,width:Math.ceil((16*(u+1)-2*y-2*b)*T),height:(2-l)*(c+1)*16-2*v-2*S,sarRatio:m}};},n.prototype=new s,e.exports={H264Stream:n,NalByteStream:a};},{48:48,49:49}],5:[function(t,e,i){e.exports={Adts:t(3),h264:t(4)};},{3:3,4:4}],6:[function(t,e,i){var n=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"];e.exports=n;},{}],7:[function(t,e,i){var n=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"];e.exports=n;},{}],8:[function(t,e,i){var n,a=[33,16,5,32,164,27],r=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],s=function(t){for(var e=[];t--;)e.push(0);return e},o=function(t){return Object.keys(t).reduce(function(e,i){return e[i]=new Uint8Array(t[i].reduce(function(t,e){return t.concat(e)},[])),e},{})};e.exports=function(){if(!n){var t={96e3:[a,[227,64],s(154),[56]],88200:[a,[231],s(170),[56]],64e3:[a,[248,192],s(240),[56]],48e3:[a,[255,192],s(268),[55,148,128],s(54),[112]],44100:[a,[255,192],s(268),[55,163,128],s(84),[112]],32e3:[a,[255,192],s(268),[55,234],s(226),[112]],24e3:[a,[255,192],s(268),[55,255,128],s(268),[111,112],s(126),[224]],16e3:[a,[255,192],s(268),[55,255,128],s(268),[111,255],s(269),[223,108],s(195),[1,192]],12e3:[r,s(268),[3,127,248],s(268),[6,255,240],s(268),[13,255,224],s(268),[27,253,128],s(259),[56]],11025:[r,s(268),[3,127,248],s(268),[6,255,240],s(268),[13,255,224],s(268),[27,255,192],s(268),[55,175,128],s(108),[112]],8e3:[r,s(268),[3,121,16],s(47),[7]]};n=o(t);}return n};},{}],9:[function(t,e,i){var n=t(49),a=function(t){this.numberOfTracks=0,this.metadataStream=t.metadataStream,this.videoTags=[],this.audioTags=[],this.videoTrack=null,this.audioTrack=null,this.pendingCaptions=[],this.pendingMetadata=[],this.pendingTracks=0,this.processedTracks=0,a.prototype.init.call(this),this.push=function(t){return t.text?this.pendingCaptions.push(t):t.frames?this.pendingMetadata.push(t):("video"===t.track.type&&(this.videoTrack=t.track,this.videoTags=t.tags,this.pendingTracks++),void("audio"===t.track.type&&(this.audioTrack=t.track,this.audioTags=t.tags,this.pendingTracks++)))};};a.prototype=new n,a.prototype.flush=function(t){var e,i,n,a,r={tags:{},captions:[],captionStreams:{},metadata:[]};if(this.pendingTracks<this.numberOfTracks){if("VideoSegmentStream"!==t&&"AudioSegmentStream"!==t)return;if(0===this.pendingTracks&&++this.processedTracks<this.numberOfTracks)return}if(this.processedTracks+=this.pendingTracks,this.pendingTracks=0,!(this.processedTracks<this.numberOfTracks)){for(this.videoTrack?a=this.videoTrack.timelineStartInfo.pts:this.audioTrack&&(a=this.audioTrack.timelineStartInfo.pts),r.tags.videoTags=this.videoTags,r.tags.audioTags=this.audioTags,n=0;n<this.pendingCaptions.length;n++)i=this.pendingCaptions[n],i.startTime=i.startPts-a,i.startTime/=9e4,i.endTime=i.endPts-a,i.endTime/=9e4,r.captionStreams[i.stream]=!0,r.captions.push(i);for(n=0;n<this.pendingMetadata.length;n++)e=this.pendingMetadata[n],e.cueTime=e.pts-a,e.cueTime/=9e4,r.metadata.push(e);r.metadata.dispatchType=this.metadataStream.dispatchType,this.videoTrack=null,this.audioTrack=null,this.videoTags=[],this.audioTags=[],this.pendingCaptions.length=0,this.pendingMetadata.length=0,this.pendingTracks=0,this.processedTracks=0,this.trigger("data",r),this.trigger("done");}},e.exports=a;},{49:49}],10:[function(t,e,i){var n=t(11),a=function(t,e,i){var a,r,s,o=new Uint8Array(9),d=new DataView(o.buffer);return t=t||0,e=void 0===e||e,i=void 0===i||i,d.setUint8(0,70),d.setUint8(1,76),d.setUint8(2,86),d.setUint8(3,1),d.setUint8(4,(e?4:0)|(i?1:0)),d.setUint32(5,o.byteLength),t<=0?(r=new Uint8Array(o.byteLength+4),r.set(o),r.set([0,0,0,0],o.byteLength),r):(a=new n(n.METADATA_TAG),a.pts=a.dts=0,a.writeMetaDataDouble("duration",t),s=a.finalize().length,r=new Uint8Array(o.byteLength+s),r.set(o),r.set(d.byteLength,s),r)};e.exports=a;},{11:11}],11:[function(t,e,i){var n;n=function(t,e){var i,a=0,r=16384,s=function(t,e){var i,n=t.position+e;n<t.bytes.byteLength||(i=new Uint8Array(2*n),i.set(t.bytes.subarray(0,t.position),0),t.bytes=i,t.view=new DataView(t.bytes.buffer));},o=n.widthBytes||new Uint8Array("width".length),d=n.heightBytes||new Uint8Array("height".length),h=n.videocodecidBytes||new Uint8Array("videocodecid".length);if(!n.widthBytes){for(i=0;i<"width".length;i++)o[i]="width".charCodeAt(i);for(i=0;i<"height".length;i++)d[i]="height".charCodeAt(i);for(i=0;i<"videocodecid".length;i++)h[i]="videocodecid".charCodeAt(i);n.widthBytes=o,n.heightBytes=d,n.videocodecidBytes=h;}switch(this.keyFrame=!1,t){case n.VIDEO_TAG:this.length=16,r*=6;break;case n.AUDIO_TAG:this.length=13,this.keyFrame=!0;break;case n.METADATA_TAG:this.length=29,this.keyFrame=!0;break;default:throw new Error("Unknown FLV tag type")}this.bytes=new Uint8Array(r),this.view=new DataView(this.bytes.buffer),this.bytes[0]=t,this.position=this.length,this.keyFrame=e,this.pts=0,this.dts=0,this.writeBytes=function(t,e,i){var n,a=e||0;i=i||t.byteLength,n=a+i,s(this,i),this.bytes.set(t.subarray(a,n),this.position),this.position+=i,this.length=Math.max(this.length,this.position);},this.writeByte=function(t){s(this,1),this.bytes[this.position]=t,this.position++,this.length=Math.max(this.length,this.position);},this.writeShort=function(t){s(this,2),this.view.setUint16(this.position,t),this.position+=2,this.length=Math.max(this.length,this.position);},this.negIndex=function(t){return this.bytes[this.length-t]},this.nalUnitSize=function(){return 0===a?0:this.length-(a+4)},this.startNalUnit=function(){if(a>0)throw new Error("Attempted to create new NAL wihout closing the old one");a=this.length,this.length+=4,this.position=this.length;},this.endNalUnit=function(t){var e,i;this.length===a+4?this.length-=4:a>0&&(e=a+4,i=this.length-e,this.position=a,this.view.setUint32(this.position,i),this.position=this.length,t&&t.push(this.bytes.subarray(e,e+i))),a=0;},this.writeMetaDataDouble=function(t,e){var i;if(s(this,2+t.length+9),this.view.setUint16(this.position,t.length),this.position+=2,"width"===t)this.bytes.set(o,this.position),this.position+=5;else if("height"===t)this.bytes.set(d,this.position),this.position+=6;else if("videocodecid"===t)this.bytes.set(h,this.position),this.position+=12;else for(i=0;i<t.length;i++)this.bytes[this.position]=t.charCodeAt(i),this.position++;this.position++,this.view.setFloat64(this.position,e),this.position+=8,this.length=Math.max(this.length,this.position),++a;},this.writeMetaDataBoolean=function(t,e){var i;for(s(this,2),this.view.setUint16(this.position,t.length),this.position+=2,i=0;i<t.length;i++)s(this,1),this.bytes[this.position]=t.charCodeAt(i),this.position++;s(this,2),this.view.setUint8(this.position,1),this.position++,this.view.setUint8(this.position,e?1:0),this.position++,this.length=Math.max(this.length,this.position),++a;},this.finalize=function(){var t,i;switch(this.bytes[0]){case n.VIDEO_TAG:this.bytes[11]=7|(this.keyFrame||e?16:32),this.bytes[12]=e?0:1,t=this.pts-this.dts,this.bytes[13]=(16711680&t)>>>16,this.bytes[14]=(65280&t)>>>8,this.bytes[15]=(255&t)>>>0;break;case n.AUDIO_TAG:this.bytes[11]=175,this.bytes[12]=e?0:1;break;case n.METADATA_TAG:this.position=11,this.view.setUint8(this.position,2),this.position++,this.view.setUint16(this.position,10),this.position+=2,this.bytes.set([111,110,77,101,116,97,68,97,116,97],this.position),this.position+=10,this.bytes[this.position]=8,this.position++,this.view.setUint32(this.position,a),this.position=this.length,this.bytes.set([0,0,9],this.position),this.position+=3,this.length=this.position;}return i=this.length-11,this.bytes[1]=(16711680&i)>>>16,this.bytes[2]=(65280&i)>>>8,this.bytes[3]=(255&i)>>>0,this.bytes[4]=(16711680&this.dts)>>>16,this.bytes[5]=(65280&this.dts)>>>8,this.bytes[6]=(255&this.dts)>>>0,this.bytes[7]=(4278190080&this.dts)>>>24,this.bytes[8]=0,this.bytes[9]=0,this.bytes[10]=0,s(this,4),this.view.setUint32(this.length,this.length),this.length+=4,this.position+=4,this.bytes=this.bytes.subarray(0,this.length),this.frameTime=n.frameTime(this.bytes),this};},n.AUDIO_TAG=8,n.VIDEO_TAG=9,n.METADATA_TAG=18,n.isAudioFrame=function(t){return n.AUDIO_TAG===t[0]},n.isVideoFrame=function(t){return n.VIDEO_TAG===t[0]},n.isMetaData=function(t){return n.METADATA_TAG===t[0]},n.isKeyFrame=function(t){return n.isVideoFrame(t)?23===t[11]:!!n.isAudioFrame(t)||!!n.isMetaData(t)},n.frameTime=function(t){var e=t[4]<<16;return e|=t[5]<<8,e|=t[6]<<0,e|=t[7]<<24},e.exports=n;},{}],12:[function(t,e,i){e.exports={tag:t(11),Transmuxer:t(14),getFlvHeader:t(10)};},{10:10,11:11,14:14}],13:[function(t,e,i){var n=function(){var t=this;this.list=[],this.push=function(t){this.list.push({bytes:t.bytes,dts:t.dts,pts:t.pts,keyFrame:t.keyFrame,metaDataTag:t.metaDataTag});},Object.defineProperty(this,"length",{get:function(){return t.list.length}});};e.exports=n;},{}],14:[function(t,e,i){var n,a,r,s,o,d,h=t(49),p=t(11),u=t(18),c=t(3),l=t(4).H264Stream,f=t(9),m=t(13);s=function(t,e){"number"==typeof e.pts&&(void 0===t.timelineStartInfo.pts?t.timelineStartInfo.pts=e.pts:t.timelineStartInfo.pts=Math.min(t.timelineStartInfo.pts,e.pts)),"number"==typeof e.dts&&(void 0===t.timelineStartInfo.dts?t.timelineStartInfo.dts=e.dts:t.timelineStartInfo.dts=Math.min(t.timelineStartInfo.dts,e.dts));},o=function(t,e){var i=new p(p.METADATA_TAG);return i.dts=e,i.pts=e,i.writeMetaDataDouble("videocodecid",7),i.writeMetaDataDouble("width",t.width),i.writeMetaDataDouble("height",t.height),i},d=function(t,e){var i,n=new p(p.VIDEO_TAG,!0);for(n.dts=e,n.pts=e,n.writeByte(1),n.writeByte(t.profileIdc),n.writeByte(t.profileCompatibility),n.writeByte(t.levelIdc),n.writeByte(255),n.writeByte(225),n.writeShort(t.sps[0].length),n.writeBytes(t.sps[0]),n.writeByte(t.pps.length),i=0;i<t.pps.length;++i)n.writeShort(t.pps[i].length),n.writeBytes(t.pps[i]);return n},r=function(t){var e,i=[],n=[];r.prototype.init.call(this),this.push=function(e){s(t,e),t&&(t.audioobjecttype=e.audioobjecttype,t.channelcount=e.channelcount,t.samplerate=e.samplerate,t.samplingfrequencyindex=e.samplingfrequencyindex,t.samplesize=e.samplesize,t.extraData=t.audioobjecttype<<11|t.samplingfrequencyindex<<7|t.channelcount<<3),e.pts=Math.round(e.pts/90),e.dts=Math.round(e.dts/90),i.push(e);},this.flush=function(){var a,r,s,o=new m;if(0===i.length)return void this.trigger("done","AudioSegmentStream");for(s=-1/0;i.length;)a=i.shift(),n.length&&a.pts>=n[0]&&(s=n.shift(),this.writeMetaDataTags(o,s)),(t.extraData!==e||a.pts-s>=1e3)&&(this.writeMetaDataTags(o,a.pts),e=t.extraData,s=a.pts),r=new p(p.AUDIO_TAG),r.pts=a.pts,r.dts=a.dts,r.writeBytes(a.data),o.push(r.finalize());n.length=0,e=null,this.trigger("data",{track:t,tags:o.list}),this.trigger("done","AudioSegmentStream");},this.writeMetaDataTags=function(e,i){var n;n=new p(p.METADATA_TAG),n.pts=i,n.dts=i,n.writeMetaDataDouble("audiocodecid",10),n.writeMetaDataBoolean("stereo",2===t.channelcount),n.writeMetaDataDouble("audiosamplerate",t.samplerate),n.writeMetaDataDouble("audiosamplesize",16),e.push(n.finalize()),n=new p(p.AUDIO_TAG,!0),n.pts=i,n.dts=i,n.view.setUint16(n.position,t.extraData),n.position+=2,n.length=Math.max(n.length,n.position),e.push(n.finalize());},this.onVideoKeyFrame=function(t){n.push(t);};},r.prototype=new h,a=function(t){var e,i,n=[];a.prototype.init.call(this),this.finishFrame=function(n,a){if(a){if(e&&t&&t.newMetadata&&(a.keyFrame||0===n.length)){var r=o(e,a.dts).finalize(),s=d(t,a.dts).finalize();r.metaDataTag=s.metaDataTag=!0,n.push(r),n.push(s),t.newMetadata=!1,this.trigger("keyframe",a.dts);}a.endNalUnit(),n.push(a.finalize()),i=null;}},this.push=function(e){s(t,e),e.pts=Math.round(e.pts/90),e.dts=Math.round(e.dts/90),n.push(e);},this.flush=function(){for(var a,r=new m;n.length&&"access_unit_delimiter_rbsp"!==n[0].nalUnitType;)n.shift();if(0===n.length)return void this.trigger("done","VideoSegmentStream");for(;n.length;)a=n.shift(),"seq_parameter_set_rbsp"===a.nalUnitType?(t.newMetadata=!0,e=a.config,t.width=e.width,t.height=e.height,t.sps=[a.data],t.profileIdc=e.profileIdc,t.levelIdc=e.levelIdc,t.profileCompatibility=e.profileCompatibility,i.endNalUnit()):"pic_parameter_set_rbsp"===a.nalUnitType?(t.newMetadata=!0,t.pps=[a.data],i.endNalUnit()):"access_unit_delimiter_rbsp"===a.nalUnitType?(i&&this.finishFrame(r,i),i=new p(p.VIDEO_TAG),i.pts=a.pts,i.dts=a.dts):("slice_layer_without_partitioning_rbsp_idr"===a.nalUnitType&&(i.keyFrame=!0),i.endNalUnit()),i.startNalUnit(),i.writeBytes(a.data);i&&this.finishFrame(r,i),this.trigger("data",{track:t,tags:r.list}),this.trigger("done","VideoSegmentStream");};},a.prototype=new h,n=function(t){var e,i,s,o,d,h,p,m,g,y,b,v,S=this;n.prototype.init.call(this),t=t||{},this.metadataStream=new u.MetadataStream,t.metadataStream=this.metadataStream,e=new u.TransportPacketStream,i=new u.TransportParseStream,s=new u.ElementaryStream,o=new u.TimestampRolloverStream("video"),d=new u.TimestampRolloverStream("audio"),h=new u.TimestampRolloverStream("timed-metadata"),p=new c,m=new l,v=new f(t),e.pipe(i).pipe(s),s.pipe(o).pipe(m),s.pipe(d).pipe(p),s.pipe(h).pipe(this.metadataStream).pipe(v),b=new u.CaptionStream,m.pipe(b).pipe(v),s.on("data",function(t){var e,i,n;if("metadata"===t.type){for(e=t.tracks.length;e--;)"video"===t.tracks[e].type?i=t.tracks[e]:"audio"===t.tracks[e].type&&(n=t.tracks[e]);i&&!g&&(v.numberOfTracks++,g=new a(i),m.pipe(g).pipe(v)),n&&!y&&(v.numberOfTracks++,y=new r(n),p.pipe(y).pipe(v),g&&g.on("keyframe",y.onVideoKeyFrame));}}),this.push=function(t){e.push(t);},this.flush=function(){e.flush();},this.resetCaptions=function(){b.reset();},v.on("data",function(t){S.trigger("data",t);}),v.on("done",function(){S.trigger("done");});},n.prototype=new h,e.exports=n;},{11:11,13:13,18:18,3:3,4:4,49:49,9:9}],15:[function(t,e,i){var n={codecs:t(5),mp4:t(27),flv:t(12),mp2t:t(17),partial:t(34)};n.mp4.tools=t(39),n.flv.tools=t(38),n.mp2t.tools=t(45),e.exports=n;},{12:12,17:17,27:27,34:34,38:38,39:39,45:45,5:5}],16:[function(t,e,i){var n=t(49),a=t(37),r=function(){r.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new g(0,0),new g(0,1),new g(1,0),new g(1,1)],this.cc708Stream_=new u,this.reset(),this.ccStreams_.forEach(function(t){t.on("data",this.trigger.bind(this,"data")),t.on("partialdone",this.trigger.bind(this,"partialdone")),t.on("done",this.trigger.bind(this,"done"));},this),this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done"));};r.prototype=new n,r.prototype.push=function(t){var e,i,n;if("sei_rbsp"===t.nalUnitType&&(e=a.parseSei(t.escapedRBSP),e.payload&&e.payloadType===a.USER_DATA_REGISTERED_ITU_T_T35&&(i=a.parseUserData(e)))){if(t.dts<this.latestDts_)return void(this.ignoreNextEqualDts_=!0);if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_)return void(--this.numSameDts_||(this.ignoreNextEqualDts_=!1));n=a.parseCaptionPackets(t.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==t.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=t.dts;}},r.prototype.flushCCStreams=function(t){this.ccStreams_.forEach(function(e){return "flush"===t?e.flush():e.partialFlush()},this);},r.prototype.flushStream=function(t){if(!this.captionPackets_.length)return void this.flushCCStreams(t);this.captionPackets_.forEach(function(t,e){t.presortIndex=e;}),this.captionPackets_.sort(function(t,e){return t.pts===e.pts?t.presortIndex-e.presortIndex:t.pts-e.pts}),this.captionPackets_.forEach(function(t){t.type<2?this.dispatchCea608Packet(t):this.dispatchCea708Packet(t);},this),this.captionPackets_.length=0,this.flushCCStreams(t);},r.prototype.flush=function(){return this.flushStream("flush")},r.prototype.partialFlush=function(){return this.flushStream("partialFlush")},r.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(t){t.reset();});},r.prototype.dispatchCea608Packet=function(t){this.setsTextOrXDSActive(t)?this.activeCea608Channel_[t.type]=null:this.setsChannel1Active(t)?this.activeCea608Channel_[t.type]=0:this.setsChannel2Active(t)&&(this.activeCea608Channel_[t.type]=1),null!==this.activeCea608Channel_[t.type]&&this.ccStreams_[(t.type<<1)+this.activeCea608Channel_[t.type]].push(t);},r.prototype.setsChannel1Active=function(t){return 4096==(30720&t.ccData)},r.prototype.setsChannel2Active=function(t){return 6144==(30720&t.ccData)},r.prototype.setsTextOrXDSActive=function(t){return 256==(28928&t.ccData)||4138==(30974&t.ccData)||6186==(30974&t.ccData)},r.prototype.dispatchCea708Packet=function(t){this.cc708Stream_.push(t);};var s={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},o=function(t){var e=s[t]||t;return 4096&t&&t===e?"":String.fromCharCode(e)},d=function(t){return 32<=t&&t<=127||160<=t&&t<=255},h=function(t){this.windowNum=t,this.reset();};h.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0;},h.prototype.getText=function(){return this.rows.join("\n")},h.prototype.clearText=function(){this.rows=[""],this.rowIdx=0;},h.prototype.newLine=function(t){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(t),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--;},h.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},h.prototype.addText=function(t){this.rows[this.rowIdx]+=t;},h.prototype.backspace=function(){if(!this.isEmpty()){var t=this.rows[this.rowIdx];this.rows[this.rowIdx]=t.substr(0,t.length-1);}};var p=function(t){this.serviceNum=t,this.text="",this.currentWindow=new h(-1),this.windows=[];};p.prototype.init=function(t,e){this.startPts=t;for(var i=0;i<8;i++)this.windows[i]=new h(i),"function"==typeof e&&(this.windows[i].beforeRowOverflow=e);},p.prototype.setCurrentWindow=function(t){this.currentWindow=this.windows[t];};var u=function(){u.prototype.init.call(this);var t=this;this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(t.new708Packet(),t.add708Bytes(e)):(null===t.current708Packet&&t.new708Packet(),t.add708Bytes(e));};};u.prototype=new n,u.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]};},u.prototype.add708Bytes=function(t){var e=t.ccData,i=e>>>8,n=255&e;this.current708Packet.ptsVals.push(t.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(n);},u.prototype.push708Packet=function(){var t=this.current708Packet,e=t.data,i=null,n=null,a=0,r=e[a++];for(t.seq=r>>6,t.sizeCode=63&r;a<e.length;a++)r=e[a++],i=r>>5,n=31&r,7===i&&n>0&&(r=e[a++],i=r),this.pushServiceBlock(i,a,n),n>0&&(a+=n-1);},u.prototype.pushServiceBlock=function(t,e,i){var n,a=e,r=this.current708Packet.data,s=this.services[t];for(s||(s=this.initService(t,a));a<e+i&&a<r.length;a++)n=r[a],d(n)?a=this.handleText(a,s):16===n?a=this.extendedCommands(a,s):128<=n&&n<=135?a=this.setCurrentWindow(a,s):152<=n&&n<=159?a=this.defineWindow(a,s):136===n?a=this.clearWindows(a,s):140===n?a=this.deleteWindows(a,s):137===n?a=this.displayWindows(a,s):138===n?a=this.hideWindows(a,s):139===n?a=this.toggleWindows(a,s):151===n?a=this.setWindowAttributes(a,s):144===n?a=this.setPenAttributes(a,s):145===n?a=this.setPenColor(a,s):146===n?a=this.setPenLocation(a,s):143===n?s=this.reset(a,s):8===n?s.currentWindow.backspace():12===n?s.currentWindow.clearText():13===n?s.currentWindow.pendingNewLine=!0:14===n?s.currentWindow.clearText():141===n&&a++;},u.prototype.extendedCommands=function(t,e){var i=this.current708Packet.data,n=i[++t];return d(n)&&(t=this.handleText(t,e,!0)),t},u.prototype.getPts=function(t){return this.current708Packet.ptsVals[Math.floor(t/2)]},u.prototype.initService=function(t,e){var i=this;return this.services[t]=new p(t),this.services[t].init(this.getPts(e),function(e){i.flushDisplayed(e,i.services[t]);}),this.services[t]},u.prototype.handleText=function(t,e,i){var n=this.current708Packet.data,a=n[t],r=i?4096:0,s=o(r|a),d=e.currentWindow;return d.pendingNewLine&&!d.isEmpty()&&d.newLine(this.getPts(t)),d.pendingNewLine=!1,d.addText(s),t},u.prototype.setCurrentWindow=function(t,e){var i=this.current708Packet.data,n=i[t],a=7&n;return e.setCurrentWindow(a),t},u.prototype.defineWindow=function(t,e){var i=this.current708Packet.data,n=i[t],a=7&n;e.setCurrentWindow(a);var r=e.currentWindow;return n=i[++t],r.visible=(32&n)>>5,r.rowLock=(16&n)>>4,r.columnLock=(8&n)>>3,r.priority=7&n,n=i[++t],r.relativePositioning=(128&n)>>7,r.anchorVertical=127&n,n=i[++t],r.anchorHorizontal=n,n=i[++t],r.anchorPoint=(240&n)>>4,r.rowCount=15&n,n=i[++t],r.columnCount=63&n,n=i[++t],r.windowStyle=(56&n)>>3,r.penStyle=7&n,r.virtualRowCount=r.rowCount+1,t},u.prototype.setWindowAttributes=function(t,e){var i=this.current708Packet.data,n=i[t],a=e.currentWindow.winAttr;return n=i[++t],a.fillOpacity=(192&n)>>6,a.fillRed=(48&n)>>4,a.fillGreen=(12&n)>>2,a.fillBlue=3&n,n=i[++t],a.borderType=(192&n)>>6,a.borderRed=(48&n)>>4,a.borderGreen=(12&n)>>2,a.borderBlue=3&n,n=i[++t],a.borderType+=(128&n)>>5,a.wordWrap=(64&n)>>6,a.printDirection=(48&n)>>4,a.scrollDirection=(12&n)>>2,a.justify=3&n,n=i[++t],a.effectSpeed=(240&n)>>4,a.effectDirection=(12&n)>>2,a.displayEffect=3&n,t},u.prototype.flushDisplayed=function(t,e){for(var i=[],n=0;n<8;n++)e.windows[n].visible&&!e.windows[n].isEmpty()&&i.push(e.windows[n].getText());e.endPts=t,e.text=i.join("\n\n"),this.pushCaption(e),e.startPts=t;},u.prototype.pushCaption=function(t){""!==t.text&&(this.trigger("data",{startPts:t.startPts,endPts:t.endPts,text:t.text,stream:"cc708_"+t.serviceNum}),t.text="",t.startPts=t.endPts);},u.prototype.displayWindows=function(t,e){var i=this.current708Packet.data,n=i[++t],a=this.getPts(t);this.flushDisplayed(a,e);for(var r=0;r<8;r++)n&1<<r&&(e.windows[r].visible=1);return t},u.prototype.hideWindows=function(t,e){var i=this.current708Packet.data,n=i[++t],a=this.getPts(t);this.flushDisplayed(a,e);for(var r=0;r<8;r++)n&1<<r&&(e.windows[r].visible=0);return t},u.prototype.toggleWindows=function(t,e){var i=this.current708Packet.data,n=i[++t],a=this.getPts(t);this.flushDisplayed(a,e);for(var r=0;r<8;r++)n&1<<r&&(e.windows[r].visible^=1);return t},u.prototype.clearWindows=function(t,e){var i=this.current708Packet.data,n=i[++t],a=this.getPts(t);this.flushDisplayed(a,e);for(var r=0;r<8;r++)n&1<<r&&e.windows[r].clearText();return t},u.prototype.deleteWindows=function(t,e){var i=this.current708Packet.data,n=i[++t],a=this.getPts(t);this.flushDisplayed(a,e);for(var r=0;r<8;r++)n&1<<r&&e.windows[r].reset();return t},u.prototype.setPenAttributes=function(t,e){var i=this.current708Packet.data,n=i[t],a=e.currentWindow.penAttr;return n=i[++t],a.textTag=(240&n)>>4,a.offset=(12&n)>>2,a.penSize=3&n,n=i[++t],a.italics=(128&n)>>7,a.underline=(64&n)>>6,a.edgeType=(56&n)>>3,a.fontStyle=7&n,t},u.prototype.setPenColor=function(t,e){var i=this.current708Packet.data,n=i[t],a=e.currentWindow.penColor;return n=i[++t],a.fgOpacity=(192&n)>>6,a.fgRed=(48&n)>>4,a.fgGreen=(12&n)>>2,a.fgBlue=3&n,n=i[++t],a.bgOpacity=(192&n)>>6,a.bgRed=(48&n)>>4,a.bgGreen=(12&n)>>2,a.bgBlue=3&n,n=i[++t],a.edgeRed=(48&n)>>4,a.edgeGreen=(12&n)>>2,a.edgeBlue=3&n,t},u.prototype.setPenLocation=function(t,e){
    var i=this.current708Packet.data,n=i[t],a=e.currentWindow.penLoc;return e.currentWindow.pendingNewLine=!0,n=i[++t],a.row=15&n,n=i[++t],a.column=63&n,t},u.prototype.reset=function(t,e){var i=this.getPts(t);return this.flushDisplayed(i,e),this.initService(e.serviceNum,t)};var c={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},l=function(t){return null===t?"":(t=c[t]||t,String.fromCharCode(t))},f=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],m=function(){for(var t=[],e=15;e--;)t.push("");return t},g=function(t,e){g.prototype.init.call(this),this.field_=t||0,this.dataChannel_=e||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(t){var e,i,n,a,r;if((e=32639&t.ccData)===this.lastControlCode_)return void(this.lastControlCode_=null);if(4096==(61440&e)?this.lastControlCode_=e:e!==this.PADDING_&&(this.lastControlCode_=null),n=e>>>8,a=255&e,e!==this.PADDING_)if(e===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(e===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(t.pts),this.flushDisplayed(t.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=t.pts;else if(e===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(t.pts);else if(e===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(t.pts);else if(e===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(t.pts);else if(e===this.CARRIAGE_RETURN_)this.clearFormatting(t.pts),this.flushDisplayed(t.pts),this.shiftRowsUp_(),this.startPts_=t.pts;else if(e===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(e===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(t.pts),this.displayed_=m();else if(e===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=m();else if(e===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(t.pts),this.displayed_=m()),this.mode_="paintOn",this.startPts_=t.pts;else if(this.isSpecialCharacter(n,a))n=(3&n)<<8,r=l(n|a),this[this.mode_](t.pts,r),this.column_++;else if(this.isExtCharacter(n,a))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),n=(3&n)<<8,r=l(n|a),this[this.mode_](t.pts,r),this.column_++;else if(this.isMidRowCode(n,a))this.clearFormatting(t.pts),this[this.mode_](t.pts," "),this.column_++,14==(14&a)&&this.addFormatting(t.pts,["i"]),1==(1&a)&&this.addFormatting(t.pts,["u"]);else if(this.isOffsetControlCode(n,a))this.column_+=3&a;else if(this.isPAC(n,a)){var s=f.indexOf(7968&e);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(t.pts,s)),s!==this.row_&&(this.clearFormatting(t.pts),this.row_=s),1&a&&-1===this.formatting_.indexOf("u")&&this.addFormatting(t.pts,["u"]),16==(16&e)&&(this.column_=4*((14&e)>>1)),this.isColorPAC(a)&&14==(14&a)&&this.addFormatting(t.pts,["i"]);}else this.isNormalChar(n)&&(0===a&&(a=null),r=l(n),r+=l(a),this[this.mode_](t.pts,r),this.column_+=r.length);};};g.prototype=new n,g.prototype.flushDisplayed=function(t){var e=this.displayed_.map(function(t){try{return t.trim()}catch(t){return console.error("Skipping malformed caption."),""}}).join("\n").replace(/^\n+|\n+$/g,"");e.length&&this.trigger("data",{startPts:this.startPts_,endPts:t,text:e,stream:this.name_});},g.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=m(),this.nonDisplayed_=m(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[];},g.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_;},g.prototype.isSpecialCharacter=function(t,e){return t===this.EXT_&&e>=48&&e<=63},g.prototype.isExtCharacter=function(t,e){return (t===this.EXT_+1||t===this.EXT_+2)&&e>=32&&e<=63},g.prototype.isMidRowCode=function(t,e){return t===this.EXT_&&e>=32&&e<=47},g.prototype.isOffsetControlCode=function(t,e){return t===this.OFFSET_&&e>=33&&e<=35},g.prototype.isPAC=function(t,e){return t>=this.BASE_&&t<this.BASE_+8&&e>=64&&e<=127},g.prototype.isColorPAC=function(t){return t>=64&&t<=79||t>=96&&t<=127},g.prototype.isNormalChar=function(t){return t>=32&&t<=127},g.prototype.setRollUp=function(t,e){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(t),this.nonDisplayed_=m(),this.displayed_=m()),void 0!==e&&e!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[e-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===e&&(e=this.row_),this.topRow_=e-this.rollUpRows_+1;},g.prototype.addFormatting=function(t,e){this.formatting_=this.formatting_.concat(e);var i=e.reduce(function(t,e){return t+"<"+e+">"},"");this[this.mode_](t,i);},g.prototype.clearFormatting=function(t){if(this.formatting_.length){var e=this.formatting_.reverse().reduce(function(t,e){return t+"</"+e+">"},"");this.formatting_=[],this[this.mode_](t,e);}},g.prototype.popOn=function(t,e){var i=this.nonDisplayed_[this.row_];i+=e,this.nonDisplayed_[this.row_]=i;},g.prototype.rollUp=function(t,e){var i=this.displayed_[this.row_];i+=e,this.displayed_[this.row_]=i;},g.prototype.shiftRowsUp_=function(){var t;for(t=0;t<this.topRow_;t++)this.displayed_[t]="";for(t=this.row_+1;t<15;t++)this.displayed_[t]="";for(t=this.topRow_;t<this.row_;t++)this.displayed_[t]=this.displayed_[t+1];this.displayed_[this.row_]="";},g.prototype.paintOn=function(t,e){var i=this.displayed_[this.row_];i+=e,this.displayed_[this.row_]=i;},e.exports={CaptionStream:r,Cea608Stream:g,Cea708Stream:u};},{37:37,49:49}],17:[function(t,e,i){e.exports=t(18);},{18:18}],18:[function(t,e,i){var n,a,r,s=t(49),o=t(16),d=t(21),h=t(22).TimestampRolloverStream;n=function(){var t=new Uint8Array(188),e=0;n.prototype.init.call(this),this.push=function(i){var n,a=0,r=188;for(e?(n=new Uint8Array(i.byteLength+e),n.set(t.subarray(0,e)),n.set(i,e),e=0):n=i;r<n.byteLength;)71!==n[a]||71!==n[r]?(a++,r++):(this.trigger("data",n.subarray(a,r)),a+=188,r+=188);a<n.byteLength&&(t.set(n.subarray(a),0),e=n.byteLength-a);},this.flush=function(){188===e&&71===t[0]&&(this.trigger("data",t),e=0),this.trigger("done");},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline");},this.reset=function(){e=0,this.trigger("reset");};},n.prototype=new s,a=function(){var t,e,i,n;a.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,t=function(t,n){var a=0;n.payloadUnitStartIndicator&&(a+=t[a]+1),"pat"===n.type?e(t.subarray(a),n):i(t.subarray(a),n);},e=function(t,e){e.section_number=t[7],e.last_section_number=t[8],n.pmtPid=(31&t[10])<<8|t[11],e.pmtPid=n.pmtPid;},i=function(t,e){var i,a,r,s;if(1&t[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=(15&t[1])<<8|t[2],a=3+i-4,r=(15&t[10])<<8|t[11],s=12+r;s<a;){var o=t[s],h=(31&t[s+1])<<8|t[s+2];o===d.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=h:o===d.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=h:o===d.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][h]=o),s+=5+((15&t[s+3])<<8|t[s+4]);}e.programMapTable=n.programMapTable;}},this.push=function(e){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&e[1]),i.pid=31&e[1],i.pid<<=8,i.pid|=e[2],(48&e[3])>>>4>1&&(n+=e[n]+1),0===i.pid)i.type="pat",t(e.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",t(e.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([e,n,i]):this.processPes_(e,n,i);},this.processPes_=function(t,e,i){i.pid===this.programMapTable.video?i.streamType=d.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=d.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=t.subarray(e),this.trigger("data",i);};},a.prototype=new s,a.STREAM_TYPES={h264:27,adts:15},r=function(){var t,e=this,i={data:[],size:0},n={data:[],size:0},a={data:[],size:0},s=function(t,e){var i;e.packetLength=6+(t[4]<<8|t[5]),e.dataAlignmentIndicator=0!=(4&t[6]),i=t[7],192&i&&(e.pts=(14&t[9])<<27|(255&t[10])<<20|(254&t[11])<<12|(255&t[12])<<5|(254&t[13])>>>3,e.pts*=4,e.pts+=(6&t[13])>>>1,e.dts=e.pts,64&i&&(e.dts=(14&t[14])<<27|(255&t[15])<<20|(254&t[16])<<12|(255&t[17])<<5|(254&t[18])>>>3,e.dts*=4,e.dts+=(6&t[18])>>>1)),e.data=t.subarray(9+t[8]);},o=function(t,i,n){var a,r=new Uint8Array(t.size),o={type:i},d=0,h=0,p=!1;if(t.data.length&&!(t.size<9)){for(o.trackId=t.data[0].pid,d=0;d<t.data.length;d++)a=t.data[d],r.set(a.data,h),h+=a.data.byteLength;s(r,o),p="video"===i||o.packetLength<=t.size,(n||p)&&(t.size=0,t.data.length=0),p&&e.trigger("data",o);}};r.prototype.init.call(this),this.push=function(r){({pat:function(){},pes:function(){var t,e;switch(r.streamType){case d.H264_STREAM_TYPE:t=i,e="video";break;case d.ADTS_STREAM_TYPE:t=n,e="audio";break;case d.METADATA_STREAM_TYPE:t=a,e="timed-metadata";break;default:return}r.payloadUnitStartIndicator&&o(t,e,!0),t.data.push(r),t.size+=r.data.byteLength;},pmt:function(){var i={type:"metadata",tracks:[]};t=r.programMapTable,null!==t.video&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.video,codec:"avc",type:"video"}),null!==t.audio&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.audio,codec:"adts",type:"audio"}),e.trigger("data",i);}})[r.type]();},this.reset=function(){i.size=0,i.data.length=0,n.size=0,n.data.length=0,this.trigger("reset");},this.flushStreams_=function(){o(i,"video"),o(n,"audio"),o(a,"timed-metadata");},this.flush=function(){this.flushStreams_(),this.trigger("done");};},r.prototype=new s;var p={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:n,TransportParseStream:a,ElementaryStream:r,TimestampRolloverStream:h,CaptionStream:o.CaptionStream,Cea608Stream:o.Cea608Stream,Cea708Stream:o.Cea708Stream,MetadataStream:t(19)};for(var u in d)d.hasOwnProperty(u)&&(p[u]=d[u]);e.exports=p;},{16:16,19:19,21:21,22:22,49:49}],19:[function(t,e,i){var n,a=t(49),r=t(21),s=function(t,e,i){var n,a="";for(n=e;n<i;n++)a+="%"+("00"+t[n].toString(16)).slice(-2);return a},o=function(t,e,i){return decodeURIComponent(s(t,e,i))},d=function(t,e,i){return unescape(s(t,e,i))},h=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},p={TXXX:function(t){var e;if(3===t.data[0]){for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=o(t.data,1,e),t.value=o(t.data,e+1,t.data.length).replace(/\0*$/,"");break}t.data=t.value;}},WXXX:function(t){var e;if(3===t.data[0])for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=o(t.data,1,e),t.url=o(t.data,e+1,t.data.length);break}},PRIV:function(t){var e;for(e=0;e<t.data.length;e++)if(0===t.data[e]){t.owner=d(t.data,0,e);break}t.privateData=t.data.subarray(e+1),t.data=t.privateData;}};n=function(t){var e,i={debug:!(!t||!t.debug),descriptor:t&&t.descriptor},a=0,s=[],o=0;if(n.prototype.init.call(this),this.dispatchType=r.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(e=0;e<i.descriptor.length;e++)this.dispatchType+=("00"+i.descriptor[e].toString(16)).slice(-2);this.push=function(t){var e,n,r,d,u,c;if("timed-metadata"===t.type){if(t.dataAlignmentIndicator&&(o=0,s.length=0),0===s.length&&(t.data.length<10||t.data[0]!=="I".charCodeAt(0)||t.data[1]!=="D".charCodeAt(0)||t.data[2]!=="3".charCodeAt(0)))return void(i.debug&&console.log("Skipping unrecognized metadata packet"));if(s.push(t),o+=t.data.byteLength,1===s.length&&(a=h(t.data.subarray(6,10)),a+=10),!(o<a)){for(e={data:new Uint8Array(a),frames:[],pts:s[0].pts,dts:s[0].dts},u=0;u<a;)e.data.set(s[0].data.subarray(0,a-u),u),u+=s[0].data.byteLength,o-=s[0].data.byteLength,s.shift();n=10,64&e.data[5]&&(n+=4,n+=h(e.data.subarray(10,14)),a-=h(e.data.subarray(16,20)));do{if((r=h(e.data.subarray(n+4,n+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if(c=String.fromCharCode(e.data[n],e.data[n+1],e.data[n+2],e.data[n+3]),d={id:c,data:e.data.subarray(n+10,n+r+10)},d.key=d.id,p[d.id]&&(p[d.id](d),"com.apple.streaming.transportStreamTimestamp"===d.owner)){var l=d.data,f=(1&l[3])<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2;f*=4,f+=3&l[7],d.timeStamp=f,void 0===e.pts&&void 0===e.dts&&(e.pts=d.timeStamp,e.dts=d.timeStamp),this.trigger("timestamp",d);}e.frames.push(d),n+=10,n+=r;}while(n<a);this.trigger("data",e);}}};},n.prototype=new a,e.exports=n;},{21:21,49:49}],20:[function(t,e,i){var n=t(21),a=function(t){var e=31&t[1];return e<<=8,e|=t[2]},r=function(t){return !!(64&t[1])},s=function(t){var e=0;return (48&t[3])>>>4>1&&(e+=t[4]+1),e},o=function(t,e){var i=a(t);return 0===i?"pat":i===e?"pmt":e?"pes":null},d=function(t){var e=r(t),i=4+s(t);return e&&(i+=t[i]+1),(31&t[i+10])<<8|t[i+11]},h=function(t){var e={},i=r(t),n=4+s(t);if(i&&(n+=t[n]+1),1&t[n+5]){var a,o,d;a=(15&t[n+1])<<8|t[n+2],o=3+a-4,d=(15&t[n+10])<<8|t[n+11];for(var h=12+d;h<o;){var p=n+h;e[(31&t[p+1])<<8|t[p+2]]=t[p],h+=5+((15&t[p+3])<<8|t[p+4]);}return e}},p=function(t,e){switch(e[a(t)]){case n.H264_STREAM_TYPE:return "video";case n.ADTS_STREAM_TYPE:return "audio";case n.METADATA_STREAM_TYPE:return "timed-metadata";default:return null}},u=function(t){if(!r(t))return null;var e=4+s(t);if(e>=t.byteLength)return null;var i,n=null;return i=t[e+7],192&i&&(n={},n.pts=(14&t[e+9])<<27|(255&t[e+10])<<20|(254&t[e+11])<<12|(255&t[e+12])<<5|(254&t[e+13])>>>3,n.pts*=4,n.pts+=(6&t[e+13])>>>1,n.dts=n.pts,64&i&&(n.dts=(14&t[e+14])<<27|(255&t[e+15])<<20|(254&t[e+16])<<12|(255&t[e+17])<<5|(254&t[e+18])>>>3,n.dts*=4,n.dts+=(6&t[e+18])>>>1)),n},c=function(t){switch(t){case 5:return "slice_layer_without_partitioning_rbsp_idr";case 6:return "sei_rbsp";case 7:return "seq_parameter_set_rbsp";case 8:return "pic_parameter_set_rbsp";case 9:return "access_unit_delimiter_rbsp";default:return null}},l=function(t){for(var e,i=4+s(t),n=t.subarray(i),a=0,r=0,o=!1;r<n.byteLength-3;r++)if(1===n[r+2]){a=r+5;break}for(;a<n.byteLength;)switch(n[a]){case 0:if(0!==n[a-1]){a+=2;break}if(0!==n[a-2]){a++;break}r+3!==a-2&&"slice_layer_without_partitioning_rbsp_idr"===(e=c(31&n[r+3]))&&(o=!0);do{a++;}while(1!==n[a]&&a<n.length);r=a-2,a+=3;break;case 1:if(0!==n[a-1]||0!==n[a-2]){a+=3;break}e=c(31&n[r+3]),"slice_layer_without_partitioning_rbsp_idr"===e&&(o=!0),r=a-2,a+=3;break;default:a+=3;}return n=n.subarray(r),a-=r,r=0,n&&n.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===(e=c(31&n[r+3]))&&(o=!0),o};e.exports={parseType:o,parsePat:d,parsePmt:h,parsePayloadUnitStartIndicator:r,parsePesType:p,parsePesTime:u,videoPacketContainsKeyFrame:l};},{21:21}],21:[function(t,e,i){e.exports={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21};},{}],22:[function(t,e,i){var n=t(49),a=function(t,e){var i=1;for(t>e&&(i=-1);Math.abs(e-t)>4294967296;)t+=8589934592*i;return t},r=function(t){var e,i;r.prototype.init.call(this),this.type_=t||"shared",this.push=function(t){"shared"!==this.type_&&t.type!==this.type_||(void 0===i&&(i=t.dts),t.dts=a(t.dts,i),t.pts=a(t.pts,i),e=t.dts,this.trigger("data",t));},this.flush=function(){i=e,this.trigger("done");},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline");},this.discontinuity=function(){i=void 0,e=void 0;},this.reset=function(){this.discontinuity(),this.trigger("reset");};};r.prototype=new n,e.exports={TimestampRolloverStream:r,handleRollover:a};},{49:49}],23:[function(t,e,i){var n=t(8),a=t(47),r=function(t){var e,i,n=0;for(e=0;e<t.length;e++)i=t[e],n+=i.data.byteLength;return n},s=function(t,e,i,r){var s,o,d,h,p=0,u=0,c=0,l=0;if(e.length&&(s=a.audioTsToVideoTs(t.baseMediaDecodeTime,t.samplerate),p=Math.ceil(a.ONE_SECOND_IN_TS/(t.samplerate/1024)),i&&r&&(u=s-Math.max(i,r),c=Math.floor(u/p),l=c*p),!(c<1||l>a.ONE_SECOND_IN_TS/2))){for(o=n()[t.samplerate],o||(o=e[0].data),d=0;d<c;d++)h=e[0],e.splice(0,0,{data:o,dts:h.dts-p,pts:h.pts-p});t.baseMediaDecodeTime-=Math.floor(a.videoTsToAudioTs(l,t.samplerate));}},o=function(t,e,i){return e.minSegmentDts>=i?t:(e.minSegmentDts=1/0,t.filter(function(t){return t.dts>=i&&(e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),e.minSegmentPts=e.minSegmentDts,!0)}))},d=function(t){var e,i,n=[];for(e=0;e<t.length;e++)i=t[e],n.push({size:i.data.byteLength,duration:1024});return n},h=function(t){var e,i,n=0,a=new Uint8Array(r(t));for(e=0;e<t.length;e++)i=t[e],a.set(i.data,n),n+=i.data.byteLength;return a};e.exports={prefixWithSilence:s,trimAdtsFramesByEarliestDts:o,generateSampleTable:d,concatenateFrameData:h};},{47:47,8:8}],24:[function(t,e,i){var n=t(37).discardEmulationPreventionBytes,a=t(16).CaptionStream,r=t(25),s=t(42),o=t(44),d=t(43),h=function(t,e){for(var i=t,n=0;n<e.length;n++){var a=e[n];if(i<a.size)return a;i-=a.size;}return null},p=function(t,e,i){var a,r,s,o,d=new DataView(t.buffer,t.byteOffset,t.byteLength),p=[];for(r=0;r+4<t.length;r+=s)if(s=d.getUint32(r),r+=4,!(s<=0))switch(31&t[r]){case 6:var u=t.subarray(r+1,r+1+s),c=h(r,e);if(a={nalUnitType:"sei_rbsp",size:s,data:u,escapedRBSP:n(u),trackId:i},c)a.pts=c.pts,a.dts=c.dts,o=c;else {if(!o){console.log("We've encountered a nal unit without data. See mux.js#233.");break}a.pts=o.pts,a.dts=o.dts;}p.push(a);}return p},u=function(t,e,i){var n=e,a=i.defaultSampleDuration||0,r=i.defaultSampleSize||0,s=i.trackId,d=[];return t.forEach(function(t){var e=o(t),i=e.samples;i.forEach(function(t){void 0===t.duration&&(t.duration=a),void 0===t.size&&(t.size=r),t.trackId=s,t.dts=n,void 0===t.compositionTimeOffset&&(t.compositionTimeOffset=0),t.pts=n+t.compositionTimeOffset,n+=t.duration;}),d=d.concat(i);}),d},c=function(t,e){var i=r(t,["moof","traf"]),n=r(t,["mdat"]),a={},o=[];return n.forEach(function(t,e){var n=i[e];o.push({mdat:t,traf:n});}),o.forEach(function(t){var i,n,o=t.mdat,h=t.traf,c=r(h,["tfhd"]),l=d(c[0]),f=l.trackId,m=r(h,["tfdt"]),g=m.length>0?s(m[0]).baseMediaDecodeTime:0,y=r(h,["trun"]);e===f&&y.length>0&&(i=u(y,g,l),n=p(o,i,f),a[f]||(a[f]=[]),a[f]=a[f].concat(n));}),a},l=function(t,e,i){var n;return null===e?null:(n=c(t,e),{seiNals:n[e],timescale:i})},f=function(){var t,e,i,n,r,s,o=!1;this.isInitialized=function(){return o},this.init=function(e){t=new a,o=!0,s=!!e&&e.isPartial,t.on("data",function(t){t.startTime=t.startPts/n,t.endTime=t.endPts/n,r.captions.push(t),r.captionStreams[t.stream]=!0;});},this.isNewInit=function(t,e){return !(t&&0===t.length||e&&"object"==typeof e&&0===Object.keys(e).length)&&(i!==t[0]||n!==e[i])},this.parse=function(t,a,s){var o;if(!this.isInitialized())return null;if(!a||!s)return null;if(this.isNewInit(a,s))i=a[0],n=s[i];else if(null===i||!n)return e.push(t),null;for(;e.length>0;){var d=e.shift();this.parse(d,a,s);}return null!==(o=l(t,i,n))&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):null},this.pushNals=function(e){if(!this.isInitialized()||!e||0===e.length)return null;e.forEach(function(e){t.push(e);});},this.flushStream=function(){if(!this.isInitialized())return null;s?t.partialFlush():t.flush();},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={};},this.resetCaptionStream=function(){if(!this.isInitialized())return null;t.reset();},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream();},this.reset=function(){e=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{}},this.resetCaptionStream();},this.reset();};e.exports=f;},{16:16,25:25,37:37,42:42,43:43,44:44}],25:[function(t,e,i){var n=t(46).toUnsigned,a=t(29),r=function(t,e){var i,s,o,d,h,p=[];if(!e.length)return null;for(i=0;i<t.byteLength;)s=n(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3]),o=a(t.subarray(i+4,i+8)),d=s>1?i+s:t.byteLength,o===e[0]&&(1===e.length?p.push(t.subarray(i+8,d)):(h=r(t.subarray(i+8,d),e.slice(1)),h.length&&(p=p.concat(h)))),i=d;return p};e.exports=r;},{29:29,46:46}],26:[function(t,e,i){var n=function(t){var e,i,n=[],a=[];for(a.byteLength=0,a.nalCount=0,a.duration=0,n.byteLength=0,e=0;e<t.length;e++)i=t[e],"access_unit_delimiter_rbsp"===i.nalUnitType?(n.length&&(n.duration=i.dts-n.dts,a.byteLength+=n.byteLength,a.nalCount+=n.length,a.duration+=n.duration,a.push(n)),n=[i],n.byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return a.length&&(!n.duration||n.duration<=0)&&(n.duration=a[a.length-1].duration),a.byteLength+=n.byteLength,a.nalCount+=n.length,a.duration+=n.duration,a.push(n),a},a=function(t){var e,i,n=[],a=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=t[0].pts,n.dts=t[0].dts,a.byteLength=0,a.nalCount=0,a.duration=0,a.pts=t[0].pts,a.dts=t[0].dts,e=0;e<t.length;e++)i=t[e],i.keyFrame?(n.length&&(a.push(n),a.byteLength+=n.byteLength,a.nalCount+=n.nalCount,a.duration+=n.duration),n=[i],n.nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return a.length&&n.duration<=0&&(n.duration=a[a.length-1].duration),a.byteLength+=n.byteLength,a.nalCount+=n.nalCount,a.duration+=n.duration,a.push(n),a},r=function(t){var e;return !t[0][0].keyFrame&&t.length>1&&(e=t.shift(),t.byteLength-=e.byteLength,t.nalCount-=e.nalCount,t[0][0].dts=e.dts,t[0][0].pts=e.pts,t[0][0].duration+=e.duration),t},s=function(){return {size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},o=function(t,e){var i=s();return i.dataOffset=e,i.compositionTimeOffset=t.pts-t.dts,i.duration=t.duration,i.size=4*t.length,i.size+=t.byteLength,t.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},d=function(t,e){var i,n,a,r,s,d=e||0,h=[];for(i=0;i<t.length;i++)for(r=t[i],n=0;n<r.length;n++)s=r[n],a=o(s,d),d+=a.size,h.push(a);return h},h=function(t){var e,i,n,a,r,s,o=0,d=t.byteLength,h=t.nalCount,p=d+4*h,u=new Uint8Array(p),c=new DataView(u.buffer);for(e=0;e<t.length;e++)for(a=t[e],i=0;i<a.length;i++)for(r=a[i],n=0;n<r.length;n++)s=r[n],c.setUint32(o,s.data.byteLength),o+=4,u.set(s.data,o),o+=s.data.byteLength;return u},p=function(t,e){var i,n=e||0,a=[];return i=o(t,n),a.push(i),a},u=function(t){var e,i,n=0,a=t.byteLength,r=t.length,s=a+4*r,o=new Uint8Array(s),d=new DataView(o.buffer);for(e=0;e<t.length;e++)i=t[e],d.setUint32(n,i.data.byteLength),n+=4,o.set(i.data,n),n+=i.data.byteLength;return o};e.exports={groupNalsIntoFrames:n,groupFramesIntoGops:a,extendFirstKeyFrame:r,generateSampleTable:d,concatenateNalData:h,generateSampleTableForFrame:p,concatenateNalDataForFrame:u};},{}],27:[function(t,e,i){e.exports={generator:t(28),probe:t(30),Transmuxer:t(32).Transmuxer,AudioSegmentStream:t(32).AudioSegmentStream,VideoSegmentStream:t(32).VideoSegmentStream,CaptionParser:t(24)};},{24:24,28:28,30:30,32:32}],28:[function(t,e,i){var n,a,r,s,o,d,h,p,u,c,l,f,m,g,y,b,v,S,T,w,_,k,U,A,D,C,P,x,I,O,L,E,M,R,F,N,B=Math.pow(2,32)-1;!function(){var t;if(U={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(t in U)U.hasOwnProperty(t)&&(U[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);A=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),C=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),D=new Uint8Array([0,0,0,1]),P=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),x=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),I={video:P,audio:x},E=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),L=new Uint8Array([0,0,0,0,0,0,0,0]),M=new Uint8Array([0,0,0,0,0,0,0,0]),R=M,F=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),N=M,O=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]);}}(),n=function(t){var e,i,n,a=[],r=0;for(e=1;e<arguments.length;e++)a.push(arguments[e]);for(e=a.length;e--;)r+=a[e].byteLength;for(i=new Uint8Array(r+8),n=new DataView(i.buffer,i.byteOffset,i.byteLength),n.setUint32(0,i.byteLength),i.set(t,4),e=0,r=8;e<a.length;e++)i.set(a[e],r),r+=a[e].byteLength;return i},a=function(){return n(U.dinf,n(U.dref,E))},r=function(t){return n(U.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,t.audioobjecttype<<3|t.samplingfrequencyindex>>>1,t.samplingfrequencyindex<<7|t.channelcount<<3,6,1,2]))},s=function(){return n(U.ftyp,A,D,A,C)},b=function(t){return n(U.hdlr,I[t])},o=function(t){return n(U.mdat,t)},y=function(t){var e=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,t.duration>>>24&255,t.duration>>>16&255,t.duration>>>8&255,255&t.duration,85,196,0,0]);return t.samplerate&&(e[12]=t.samplerate>>>24&255,e[13]=t.samplerate>>>16&255,e[14]=t.samplerate>>>8&255,e[15]=255&t.samplerate),n(U.mdhd,e)},g=function(t){return n(U.mdia,y(t),b(t.type),h(t))},d=function(t){return n(U.mfhd,new Uint8Array([0,0,0,0,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t]))},h=function(t){return n(U.minf,"video"===t.type?n(U.vmhd,O):n(U.smhd,L),a(),S(t))},p=function(t,e){for(var i=[],a=e.length;a--;)i[a]=w(e[a]);return n.apply(null,[U.moof,d(t)].concat(i))},u=function(t){for(var e=t.length,i=[];e--;)i[e]=f(t[e]);return n.apply(null,[U.moov,l(4294967295)].concat(i).concat(c(t)))},c=function(t){for(var e=t.length,i=[];e--;)i[e]=_(t[e]);return n.apply(null,[U.mvex].concat(i))},l=function(t){var e=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return n(U.mvhd,e)},v=function(t){var e,i,a=t.samples||[],r=new Uint8Array(4+a.length);for(i=0;i<a.length;i++)e=a[i].flags,r[i+4]=e.dependsOn<<4|e.isDependedOn<<2|e.hasRedundancy;return n(U.sdtp,r)},S=function(t){return n(U.stbl,T(t),n(U.stts,N),n(U.stsc,R),n(U.stsz,F),n(U.stco,M))},function(){var t,e;T=function(i){return n(U.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===i.type?t(i):e(i))},t=function(t){var e,i,a=t.sps||[],r=t.pps||[],s=[],o=[];for(e=0;e<a.length;e++)s.push((65280&a[e].byteLength)>>>8),s.push(255&a[e].byteLength),s=s.concat(Array.prototype.slice.call(a[e]));for(e=0;e<r.length;e++)o.push((65280&r[e].byteLength)>>>8),o.push(255&r[e].byteLength),o=o.concat(Array.prototype.slice.call(r[e]));if(i=[U.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&t.width)>>8,255&t.width,(65280&t.height)>>8,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),n(U.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([a.length],s,[r.length],o))),n(U.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],t.sarRatio){var d=t.sarRatio[0],h=t.sarRatio[1];i.push(n(U.pasp,new Uint8Array([(4278190080&d)>>24,(16711680&d)>>16,(65280&d)>>8,255&d,(4278190080&h)>>24,(16711680&h)>>16,(65280&h)>>8,255&h])));}return n.apply(null,i)},e=function(t){return n(U.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&t.channelcount)>>8,255&t.channelcount,(65280&t.samplesize)>>8,255&t.samplesize,0,0,0,0,(65280&t.samplerate)>>8,255&t.samplerate,0,0]),r(t))};}(),m=function(t){var e=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,0,(4278190080&t.duration)>>24,(16711680&t.duration)>>16,(65280&t.duration)>>8,255&t.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&t.width)>>8,255&t.width,0,0,(65280&t.height)>>8,255&t.height,0,0]);return n(U.tkhd,e)},w=function(t){var e,i,a,r,s,o,d;return e=n(U.tfhd,new Uint8Array([0,0,0,58,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),o=Math.floor(t.baseMediaDecodeTime/(B+1)),d=Math.floor(t.baseMediaDecodeTime%(B+1)),i=n(U.tfdt,new Uint8Array([1,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,255&o,d>>>24&255,d>>>16&255,d>>>8&255,255&d])),s=92,"audio"===t.type?(a=k(t,s),n(U.traf,e,i,a)):(r=v(t),a=k(t,r.length+s),n(U.traf,e,i,a,r))},f=function(t){return t.duration=t.duration||4294967295,n(U.trak,m(t),g(t))},_=function(t){var e=new Uint8Array([0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return "video"!==t.type&&(e[e.length-1]=0),n(U.trex,e)},function(){var t,e,i;i=function(t,e){var i=0,n=0,a=0,r=0;return t.length&&(void 0!==t[0].duration&&(i=1),void 0!==t[0].size&&(n=2),void 0!==t[0].flags&&(a=4),void 0!==t[0].compositionTimeOffset&&(r=8)),[0,0,i|n|a|r,1,(4278190080&t.length)>>>24,(16711680&t.length)>>>16,(65280&t.length)>>>8,255&t.length,(4278190080&e)>>>24,(16711680&e)>>>16,(65280&e)>>>8,255&e]},e=function(t,e){var a,r,s,o,d,h;for(o=t.samples||[],e+=20+16*o.length,s=i(o,e),r=new Uint8Array(s.length+16*o.length),r.set(s),a=s.length,h=0;h<o.length;h++)d=o[h],r[a++]=(4278190080&d.duration)>>>24,r[a++]=(16711680&d.duration)>>>16,r[a++]=(65280&d.duration)>>>8,r[a++]=255&d.duration,r[a++]=(4278190080&d.size)>>>24,r[a++]=(16711680&d.size)>>>16,r[a++]=(65280&d.size)>>>8,r[a++]=255&d.size,r[a++]=d.flags.isLeading<<2|d.flags.dependsOn,r[a++]=d.flags.isDependedOn<<6|d.flags.hasRedundancy<<4|d.flags.paddingValue<<1|d.flags.isNonSyncSample,r[a++]=61440&d.flags.degradationPriority,r[a++]=15&d.flags.degradationPriority,r[a++]=(4278190080&d.compositionTimeOffset)>>>24,r[a++]=(16711680&d.compositionTimeOffset)>>>16,r[a++]=(65280&d.compositionTimeOffset)>>>8,r[a++]=255&d.compositionTimeOffset;return n(U.trun,r)},t=function(t,e){var a,r,s,o,d,h;for(o=t.samples||[],e+=20+8*o.length,s=i(o,e),a=new Uint8Array(s.length+8*o.length),a.set(s),r=s.length,h=0;h<o.length;h++)d=o[h],a[r++]=(4278190080&d.duration)>>>24,a[r++]=(16711680&d.duration)>>>16,a[r++]=(65280&d.duration)>>>8,a[r++]=255&d.duration,a[r++]=(4278190080&d.size)>>>24,a[r++]=(16711680&d.size)>>>16,a[r++]=(65280&d.size)>>>8,a[r++]=255&d.size;return n(U.trun,a)},k=function(i,n){return "audio"===i.type?t(i,n):e(i,n)};}(),e.exports={ftyp:s,mdat:o,moof:p,moov:u,initSegment:function(t){var e,i=s(),n=u(t);return e=new Uint8Array(i.byteLength+n.byteLength),e.set(i),e.set(n,i.byteLength),e}};},{}],29:[function(t,e,i){var n=function(t){var e="";return e+=String.fromCharCode(t[0]),e+=String.fromCharCode(t[1]),e+=String.fromCharCode(t[2]),e+=String.fromCharCode(t[3])};e.exports=n;
    },{}],30:[function(t,e,i){var n,a,r,s,o,d,h=t(46).toUnsigned,p=t(46).toHexString,u=t(25),c=t(29),l=t(43),f=t(44),m=t(42);n=function(t){var e={};return u(t,["moov","trak"]).reduce(function(t,e){var i,n,a,r,s;return (i=u(e,["tkhd"])[0])?(n=i[0],a=0===n?12:20,r=h(i[a]<<24|i[a+1]<<16|i[a+2]<<8|i[a+3]),(s=u(e,["mdia","mdhd"])[0])?(n=s[0],a=0===n?12:20,t[r]=h(s[a]<<24|s[a+1]<<16|s[a+2]<<8|s[a+3]),t):null):null},e)},a=function(t,e){var i,n,a;return i=u(e,["moof","traf"]),n=[].concat.apply([],i.map(function(e){return u(e,["tfhd"]).map(function(i){var n,a,r;return n=h(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),a=t[n]||9e4,r=u(e,["tfdt"]).map(function(t){var e,i;return e=t[0],i=h(t[4]<<24|t[5]<<16|t[6]<<8|t[7]),1===e&&(i*=Math.pow(2,32),i+=h(t[8]<<24|t[9]<<16|t[10]<<8|t[11])),i})[0],(r="number"!=typeof r||isNaN(r)?1/0:r)/a})})),a=Math.min.apply(null,n),isFinite(a)?a:0},r=function(t,e){var i,n=u(e,["moof","traf"]),a=0,r=0;if(n&&n.length){var s=u(n[0],["tfhd"])[0],o=u(n[0],["trun"])[0],d=u(n[0],["tfdt"])[0];if(s){i=l(s).trackId;}if(d){a=m(d).baseMediaDecodeTime;}if(o){var h=f(o);h.samples&&h.samples.length&&(r=h.samples[0].compositionTimeOffset||0);}}return (a+r)/(t[i]||9e4)},s=function(t){var e=u(t,["moov","trak"]),i=[];return e.forEach(function(t){var e=u(t,["mdia","hdlr"]),n=u(t,["tkhd"]);e.forEach(function(t,e){var a,r,s,o=c(t.subarray(8,12)),d=n[e];"vide"===o&&(a=new DataView(d.buffer,d.byteOffset,d.byteLength),r=a.getUint8(0),s=0===r?a.getUint32(12):a.getUint32(20),i.push(s));});}),i},d=function(t){var e=t[0],i=0===e?12:20;return h(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])},o=function(t){var e=u(t,["moov","trak"]),i=[];return e.forEach(function(t){var e,n,a={},r=u(t,["tkhd"])[0];r&&(e=new DataView(r.buffer,r.byteOffset,r.byteLength),n=e.getUint8(0),a.id=0===n?e.getUint32(12):e.getUint32(20));var s=u(t,["mdia","hdlr"])[0];if(s){var o=c(s.subarray(8,12));a.type="vide"===o?"video":"soun"===o?"audio":o;}var h=u(t,["mdia","minf","stbl","stsd"])[0];if(h){var l=h.subarray(8);a.codec=c(l.subarray(4,8));var f,m,g=u(l,[a.codec])[0];g&&(/^[a-z]vc[1-9]$/i.test(a.codec)?(f=g.subarray(78),m=c(f.subarray(4,8)),"avcC"===m&&f.length>11?(a.codec+=".",a.codec+=p(f[9]),a.codec+=p(f[10]),a.codec+=p(f[11])):a.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(a.codec)?(f=g.subarray(28),m=c(f.subarray(4,8)),"esds"===m&&f.length>20&&0!==f[19]?(a.codec+="."+p(f[19]),a.codec+="."+p(f[20]>>>2&63).replace(/^0/,"")):a.codec="mp4a.40.2"):a.codec=a.codec.toLowerCase());}var y=u(t,["mdia","mdhd"])[0];y&&(a.timescale=d(y)),i.push(a);}),i},e.exports={findBox:u,parseType:c,timescale:n,startTime:a,compositionStartTime:r,videoTrackIds:s,tracks:o,getTimescaleFromMediaHeader:d};},{25:25,29:29,42:42,43:43,44:44,46:46}],31:[function(t,e,i){var n=t(47).ONE_SECOND_IN_TS,a=function(t,e){"number"==typeof e.pts&&(void 0===t.timelineStartInfo.pts&&(t.timelineStartInfo.pts=e.pts),void 0===t.minSegmentPts?t.minSegmentPts=e.pts:t.minSegmentPts=Math.min(t.minSegmentPts,e.pts),void 0===t.maxSegmentPts?t.maxSegmentPts=e.pts:t.maxSegmentPts=Math.max(t.maxSegmentPts,e.pts)),"number"==typeof e.dts&&(void 0===t.timelineStartInfo.dts&&(t.timelineStartInfo.dts=e.dts),void 0===t.minSegmentDts?t.minSegmentDts=e.dts:t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),void 0===t.maxSegmentDts?t.maxSegmentDts=e.dts:t.maxSegmentDts=Math.max(t.maxSegmentDts,e.dts));},r=function(t){delete t.minSegmentDts,delete t.maxSegmentDts,delete t.minSegmentPts,delete t.maxSegmentPts;},s=function(t,e){var i,a,r=t.minSegmentDts;return e||(r-=t.timelineStartInfo.dts),i=t.timelineStartInfo.baseMediaDecodeTime,i+=r,i=Math.max(0,i),"audio"===t.type&&(a=t.samplerate/n,i*=a,i=Math.floor(i)),i};e.exports={clearDtsInfo:r,calculateTrackBaseMediaDecodeTime:s,collectDtsInfo:a};},{47:47}],32:[function(t,e,i){var n,a,r,s,o=t(49),d=t(28),h=t(26),p=t(23),u=t(31),c=t(18),l=t(47),f=t(3),m=t(4).H264Stream,g=t(1),y=t(2).isLikelyAacData,b=t(47).ONE_SECOND_IN_TS,v=t(6),S=t(7),T=function(t,e){var i;if(t.length!==e.length)return !1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return !1;return !0},w=function(t,e,i,n,a,r){return {start:{dts:t,pts:t+(i-e)},end:{dts:t+(n-e),pts:t+(a-i)},prependedContentDuration:r,baseMediaDecodeTime:t}};a=function(t,e){var i=[],n=0,r=0,s=0,o=1/0;e=e||{},a.prototype.init.call(this),this.push=function(e){u.collectDtsInfo(t,e),t&&v.forEach(function(i){t[i]=e[i];}),i.push(e);},this.setEarliestDts=function(t){r=t;},this.setVideoBaseMediaDecodeTime=function(t){o=t;},this.setAudioAppendStart=function(t){s=t;},this.flush=function(){var a,h,c,l,f;if(0===i.length)return void this.trigger("done","AudioSegmentStream");a=p.trimAdtsFramesByEarliestDts(i,t,r),t.baseMediaDecodeTime=u.calculateTrackBaseMediaDecodeTime(t,e.keepOriginalTimestamps),p.prefixWithSilence(t,a,s,o),t.samples=p.generateSampleTable(a),c=d.mdat(p.concatenateFrameData(a)),i=[],h=d.moof(n,[t]),l=new Uint8Array(h.byteLength+c.byteLength),n++,l.set(h),l.set(c,h.byteLength),u.clearDtsInfo(t),f=Math.ceil(1024*b/t.samplerate),a.length&&this.trigger("timingInfo",{start:a[0].pts,end:a[0].pts+a.length*f}),this.trigger("data",{track:t,boxes:l}),this.trigger("done","AudioSegmentStream");},this.reset=function(){u.clearDtsInfo(t),i=[],this.trigger("reset");};},a.prototype=new o,n=function(t,e){var i,a,r=0,s=[],o=[];e=e||{},n.prototype.init.call(this),delete t.minPTS,this.gopCache_=[],this.push=function(e){u.collectDtsInfo(t,e),"seq_parameter_set_rbsp"!==e.nalUnitType||i||(i=e.config,t.sps=[e.data],S.forEach(function(e){t[e]=i[e];},this)),"pic_parameter_set_rbsp"!==e.nalUnitType||a||(a=e.data,t.pps=[e.data]),s.push(e);},this.flush=function(){for(var i,n,a,p,c,l,f,m,g=0;s.length&&"access_unit_delimiter_rbsp"!==s[0].nalUnitType;)s.shift();if(0===s.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(i=h.groupNalsIntoFrames(s),a=h.groupFramesIntoGops(i),a[0][0].keyFrame||(n=this.getGopForFusion_(s[0],t),n?(g=n.duration,a.unshift(n),a.byteLength+=n.byteLength,a.nalCount+=n.nalCount,a.pts=n.pts,a.dts=n.dts,a.duration+=n.duration):a=h.extendFirstKeyFrame(a)),o.length){var y;if(!(y=e.alignGopsAtEnd?this.alignGopsAtEnd_(a):this.alignGopsAtStart_(a)))return this.gopCache_.unshift({gop:a.pop(),pps:t.pps,sps:t.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");u.clearDtsInfo(t),a=y;}u.collectDtsInfo(t,a),t.samples=h.generateSampleTable(a),c=d.mdat(h.concatenateNalData(a)),t.baseMediaDecodeTime=u.calculateTrackBaseMediaDecodeTime(t,e.keepOriginalTimestamps),this.trigger("processedGopsInfo",a.map(function(t){return {pts:t.pts,dts:t.dts,byteLength:t.byteLength}})),f=a[0],m=a[a.length-1],this.trigger("segmentTimingInfo",w(t.baseMediaDecodeTime,f.dts,f.pts,m.dts+m.duration,m.pts+m.duration,g)),this.trigger("timingInfo",{start:a[0].pts,end:a[a.length-1].pts+a[a.length-1].duration}),this.gopCache_.unshift({gop:a.pop(),pps:t.pps,sps:t.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),s=[],this.trigger("baseMediaDecodeTime",t.baseMediaDecodeTime),this.trigger("timelineStartInfo",t.timelineStartInfo),p=d.moof(r,[t]),l=new Uint8Array(p.byteLength+c.byteLength),r++,l.set(p),l.set(c,p.byteLength),this.trigger("data",{track:t,boxes:l}),this.resetStream_(),this.trigger("done","VideoSegmentStream");},this.reset=function(){this.resetStream_(),s=[],this.gopCache_.length=0,o.length=0,this.trigger("reset");},this.resetStream_=function(){u.clearDtsInfo(t),i=void 0,a=void 0;},this.getGopForFusion_=function(e){var i,n,a,r,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)r=this.gopCache_[s],a=r.gop,t.pps&&T(t.pps[0],r.pps[0])&&t.sps&&T(t.sps[0],r.sps[0])&&(a.dts<t.timelineStartInfo.dts||(i=e.dts-a.dts-a.duration)>=-1e4&&i<=45e3&&(!n||o>i)&&(n=r,o=i));return n?n.gop:null},this.alignGopsAtStart_=function(t){var e,i,n,a,r,s,d,h;for(r=t.byteLength,s=t.nalCount,d=t.duration,e=i=0;e<o.length&&i<t.length&&(n=o[e],a=t[i],n.pts!==a.pts);)a.pts>n.pts?e++:(i++,r-=a.byteLength,s-=a.nalCount,d-=a.duration);return 0===i?t:i===t.length?null:(h=t.slice(i),h.byteLength=r,h.duration=d,h.nalCount=s,h.pts=h[0].pts,h.dts=h[0].dts,h)},this.alignGopsAtEnd_=function(t){var e,i,n,a,r,s;for(e=o.length-1,i=t.length-1,r=null,s=!1;e>=0&&i>=0;){if(n=o[e],a=t[i],n.pts===a.pts){s=!0;break}n.pts>a.pts?e--:(e===o.length-1&&(r=i),i--);}if(!s&&null===r)return null;var d;if(0===(d=s?i:r))return t;var h=t.slice(d),p=h.reduce(function(t,e){return t.byteLength+=e.byteLength,t.duration+=e.duration,t.nalCount+=e.nalCount,t},{byteLength:0,duration:0,nalCount:0});return h.byteLength=p.byteLength,h.duration=p.duration,h.nalCount=p.nalCount,h.pts=h[0].pts,h.dts=h[0].dts,h},this.alignGopsWith=function(t){o=t;};},n.prototype=new o,s=function(t,e){this.numberOfTracks=0,this.metadataStream=e,t=t||{},void 0!==t.remux?this.remuxTracks=!!t.remux:this.remuxTracks=!0,"boolean"==typeof t.keepOriginalTimestamps?this.keepOriginalTimestamps=t.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,s.prototype.init.call(this),this.push=function(t){return t.text?this.pendingCaptions.push(t):t.frames?this.pendingMetadata.push(t):(this.pendingTracks.push(t.track),this.pendingBytes+=t.boxes.byteLength,"video"===t.track.type&&(this.videoTrack=t.track,this.pendingBoxes.push(t.boxes)),void("audio"===t.track.type&&(this.audioTrack=t.track,this.pendingBoxes.unshift(t.boxes))))};},s.prototype=new o,s.prototype.flush=function(t){var e,i,n,a,r=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==t&&"AudioSegmentStream"!==t)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return void(++this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,S.forEach(function(t){s.info[t]=this.videoTrack[t];},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,v.forEach(function(t){s.info[t]=this.audioTrack[t];},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=d.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),a=0;a<this.pendingBoxes.length;a++)s.data.set(this.pendingBoxes[a],r),r+=this.pendingBoxes[a].byteLength;for(a=0;a<this.pendingCaptions.length;a++)e=this.pendingCaptions[a],e.startTime=l.metadataTsToSeconds(e.startPts,o,this.keepOriginalTimestamps),e.endTime=l.metadataTsToSeconds(e.endPts,o,this.keepOriginalTimestamps),s.captionStreams[e.stream]=!0,s.captions.push(e);for(a=0;a<this.pendingMetadata.length;a++)i=this.pendingMetadata[a],i.cueTime=l.metadataTsToSeconds(i.pts,o,this.keepOriginalTimestamps),s.metadata.push(i);for(s.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",s),a=0;a<s.captions.length;a++)e=s.captions[a],this.trigger("caption",e);for(a=0;a<s.metadata.length;a++)i=s.metadata[a],this.trigger("id3Frame",i);}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);},s.prototype.setRemux=function(t){this.remuxTracks=t;},r=function(t){var e,i,o=this,d=!0;r.prototype.init.call(this),t=t||{},this.baseMediaDecodeTime=t.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var n={};this.transmuxPipeline_=n,n.type="aac",n.metadataStream=new c.MetadataStream,n.aacStream=new g,n.audioTimestampRolloverStream=new c.TimestampRolloverStream("audio"),n.timedMetadataTimestampRolloverStream=new c.TimestampRolloverStream("timed-metadata"),n.adtsStream=new f,n.coalesceStream=new s(t,n.metadataStream),n.headOfPipeline=n.aacStream,n.aacStream.pipe(n.audioTimestampRolloverStream).pipe(n.adtsStream),n.aacStream.pipe(n.timedMetadataTimestampRolloverStream).pipe(n.metadataStream).pipe(n.coalesceStream),n.metadataStream.on("timestamp",function(t){n.aacStream.setTimestamp(t.timeStamp);}),n.aacStream.on("data",function(r){"timed-metadata"!==r.type&&"audio"!==r.type||n.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:o.baseMediaDecodeTime},codec:"adts",type:"audio"},n.coalesceStream.numberOfTracks++,n.audioSegmentStream=new a(i,t),n.audioSegmentStream.on("timingInfo",o.trigger.bind(o,"audioTimingInfo")),n.adtsStream.pipe(n.audioSegmentStream).pipe(n.coalesceStream),o.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!e}));}),n.coalesceStream.on("data",this.trigger.bind(this,"data")),n.coalesceStream.on("done",this.trigger.bind(this,"done"));},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new c.MetadataStream,r.packetStream=new c.TransportPacketStream,r.parseStream=new c.TransportParseStream,r.elementaryStream=new c.ElementaryStream,r.timestampRolloverStream=new c.TimestampRolloverStream,r.adtsStream=new f,r.h264Stream=new m,r.captionStream=new c.CaptionStream,r.coalesceStream=new s(t,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",function(s){var d;if("metadata"===s.type){for(d=s.tracks.length;d--;)e||"video"!==s.tracks[d].type?i||"audio"!==s.tracks[d].type||(i=s.tracks[d],i.timelineStartInfo.baseMediaDecodeTime=o.baseMediaDecodeTime):(e=s.tracks[d],e.timelineStartInfo.baseMediaDecodeTime=o.baseMediaDecodeTime);e&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new n(e,t),r.videoSegmentStream.on("timelineStartInfo",function(e){i&&!t.keepOriginalTimestamps&&(i.timelineStartInfo=e,r.audioSegmentStream.setEarliestDts(e.dts-o.baseMediaDecodeTime));}),r.videoSegmentStream.on("processedGopsInfo",o.trigger.bind(o,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",o.trigger.bind(o,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",function(t){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(t);}),r.videoSegmentStream.on("timingInfo",o.trigger.bind(o,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new a(i,t),r.audioSegmentStream.on("timingInfo",o.trigger.bind(o,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),o.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!e});}}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",function(t){t.dispatchType=r.metadataStream.dispatchType,o.trigger("id3Frame",t);}),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done"));},this.setBaseMediaDecodeTime=function(n){var a=this.transmuxPipeline_;t.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,u.clearDtsInfo(i),a.audioTimestampRolloverStream&&a.audioTimestampRolloverStream.discontinuity()),e&&(a.videoSegmentStream&&(a.videoSegmentStream.gopCache_=[]),e.timelineStartInfo.dts=void 0,e.timelineStartInfo.pts=void 0,u.clearDtsInfo(e),a.captionStream.reset()),a.timestampRolloverStream&&a.timestampRolloverStream.discontinuity();},this.setAudioAppendStart=function(t){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(t);},this.setRemux=function(e){var i=this.transmuxPipeline_;t.remux=e,i&&i.coalesceStream&&i.coalesceStream.setRemux(e);},this.alignGopsWith=function(t){e&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(t);},this.push=function(t){if(d){var e=y(t);e&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():e||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),d=!1;}this.transmuxPipeline_.headOfPipeline.push(t);},this.flush=function(){d=!0,this.transmuxPipeline_.headOfPipeline.flush();},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline();},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset();},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset();};},r.prototype=new o,e.exports={Transmuxer:r,VideoSegmentStream:n,AudioSegmentStream:a,AUDIO_PROPERTIES:v,VIDEO_PROPERTIES:S,generateVideoSegmentTimingInfo:w};},{1:1,18:18,2:2,23:23,26:26,28:28,3:3,31:31,4:4,47:47,49:49,6:6,7:7}],33:[function(t,e,i){var n=t(49),a=t(28),r=t(23),s=t(31),o=t(47).ONE_SECOND_IN_TS,d=t(6),h=function(t,e){var i=[],n=0,p=0,u=0,c=1/0,l=null,f=null;e=e||{},h.prototype.init.call(this),this.push=function(e){s.collectDtsInfo(t,e),t&&d.forEach(function(i){t[i]=e[i];}),i.push(e);},this.setEarliestDts=function(t){p=t;},this.setVideoBaseMediaDecodeTime=function(t){c=t;},this.setAudioAppendStart=function(t){u=t;},this.processFrames_=function(){var d,h,m,g,y;0!==i.length&&(d=r.trimAdtsFramesByEarliestDts(i,t,p),0!==d.length&&(t.baseMediaDecodeTime=s.calculateTrackBaseMediaDecodeTime(t,e.keepOriginalTimestamps),r.prefixWithSilence(t,d,u,c),t.samples=r.generateSampleTable(d),m=a.mdat(r.concatenateFrameData(d)),i=[],h=a.moof(n,[t]),n++,t.initSegment=a.initSegment([t]),g=new Uint8Array(h.byteLength+m.byteLength),g.set(h),g.set(m,h.byteLength),s.clearDtsInfo(t),null===l&&(f=l=d[0].pts),f+=d.length*(1024*o/t.samplerate),y={start:l},this.trigger("timingInfo",y),this.trigger("data",{track:t,boxes:g})));},this.flush=function(){this.processFrames_(),this.trigger("timingInfo",{start:l,end:f}),this.resetTiming_(),this.trigger("done","AudioSegmentStream");},this.partialFlush=function(){this.processFrames_(),this.trigger("partialdone","AudioSegmentStream");},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline","AudioSegmentStream");},this.resetTiming_=function(){s.clearDtsInfo(t),l=null,f=null;},this.reset=function(){this.resetTiming_(),i=[],this.trigger("reset");};};h.prototype=new n,e.exports=h;},{23:23,28:28,31:31,47:47,49:49,6:6}],34:[function(t,e,i){e.exports={Transmuxer:t(35)};},{35:35}],35:[function(t,e,i){var n=t(49),a=t(18),r=t(5),s=t(33),o=t(36),d=t(31),h=t(2).isLikelyAacData,p=t(3),u=t(1),c=t(47),l=function(t){return t.prototype=new n,t.prototype.init.call(t),t},f=function(t){var e={type:"ts",tracks:{audio:null,video:null},packet:new a.TransportPacketStream,parse:new a.TransportParseStream,elementary:new a.ElementaryStream,timestampRollover:new a.TimestampRolloverStream,adts:new r.Adts,h264:new r.h264.H264Stream,captionStream:new a.CaptionStream,metadataStream:new a.MetadataStream};return e.headOfPipeline=e.packet,e.packet.pipe(e.parse).pipe(e.elementary).pipe(e.timestampRollover),e.timestampRollover.pipe(e.h264),e.h264.pipe(e.captionStream),e.timestampRollover.pipe(e.metadataStream),e.timestampRollover.pipe(e.adts),e.elementary.on("data",function(i){if("metadata"===i.type){for(var n=0;n<i.tracks.length;n++)e.tracks[i.tracks[n].type]||(e.tracks[i.tracks[n].type]=i.tracks[n],e.tracks[i.tracks[n].type].timelineStartInfo.baseMediaDecodeTime=t.baseMediaDecodeTime);e.tracks.video&&!e.videoSegmentStream&&(e.videoSegmentStream=new o(e.tracks.video,t),e.videoSegmentStream.on("timelineStartInfo",function(i){e.tracks.audio&&!t.keepOriginalTimestamps&&e.audioSegmentStream.setEarliestDts(i.dts-t.baseMediaDecodeTime);}),e.videoSegmentStream.on("timingInfo",e.trigger.bind(e,"videoTimingInfo")),e.videoSegmentStream.on("data",function(t){e.trigger("data",{type:"video",data:t});}),e.videoSegmentStream.on("done",e.trigger.bind(e,"done")),e.videoSegmentStream.on("partialdone",e.trigger.bind(e,"partialdone")),e.videoSegmentStream.on("endedtimeline",e.trigger.bind(e,"endedtimeline")),e.h264.pipe(e.videoSegmentStream)),e.tracks.audio&&!e.audioSegmentStream&&(e.audioSegmentStream=new s(e.tracks.audio,t),e.audioSegmentStream.on("data",function(t){e.trigger("data",{type:"audio",data:t});}),e.audioSegmentStream.on("done",e.trigger.bind(e,"done")),e.audioSegmentStream.on("partialdone",e.trigger.bind(e,"partialdone")),e.audioSegmentStream.on("endedtimeline",e.trigger.bind(e,"endedtimeline")),e.audioSegmentStream.on("timingInfo",e.trigger.bind(e,"audioTimingInfo")),e.adts.pipe(e.audioSegmentStream)),e.trigger("trackinfo",{hasAudio:!!e.tracks.audio,hasVideo:!!e.tracks.video});}}),e.captionStream.on("data",function(i){var n;n=e.tracks.video?e.tracks.video.timelineStartInfo.pts||0:0,i.startTime=c.metadataTsToSeconds(i.startPts,n,t.keepOriginalTimestamps),i.endTime=c.metadataTsToSeconds(i.endPts,n,t.keepOriginalTimestamps),e.trigger("caption",i);}),e=l(e),e.metadataStream.on("data",e.trigger.bind(e,"id3Frame")),e},m=function(t){var e={type:"aac",tracks:{audio:null},metadataStream:new a.MetadataStream,aacStream:new u,audioRollover:new a.TimestampRolloverStream("audio"),timedMetadataRollover:new a.TimestampRolloverStream("timed-metadata"),adtsStream:new p(!0)};return e.headOfPipeline=e.aacStream,e.aacStream.pipe(e.audioRollover).pipe(e.adtsStream),e.aacStream.pipe(e.timedMetadataRollover).pipe(e.metadataStream),e.metadataStream.on("timestamp",function(t){e.aacStream.setTimestamp(t.timeStamp);}),e.aacStream.on("data",function(i){"timed-metadata"!==i.type&&"audio"!==i.type||e.audioSegmentStream||(e.tracks.audio=e.tracks.audio||{timelineStartInfo:{baseMediaDecodeTime:t.baseMediaDecodeTime},codec:"adts",type:"audio"},e.audioSegmentStream=new s(e.tracks.audio,t),e.audioSegmentStream.on("data",function(t){e.trigger("data",{type:"audio",data:t});}),e.audioSegmentStream.on("partialdone",e.trigger.bind(e,"partialdone")),e.audioSegmentStream.on("done",e.trigger.bind(e,"done")),e.audioSegmentStream.on("endedtimeline",e.trigger.bind(e,"endedtimeline")),e.audioSegmentStream.on("timingInfo",e.trigger.bind(e,"audioTimingInfo")),e.adtsStream.pipe(e.audioSegmentStream),e.trigger("trackinfo",{hasAudio:!!e.tracks.audio,hasVideo:!!e.tracks.video}));}),e=l(e),e.metadataStream.on("data",e.trigger.bind(e,"id3Frame")),e},g=function(t,e){t.on("data",e.trigger.bind(e,"data")),t.on("done",e.trigger.bind(e,"done")),t.on("partialdone",e.trigger.bind(e,"partialdone")),t.on("endedtimeline",e.trigger.bind(e,"endedtimeline")),t.on("audioTimingInfo",e.trigger.bind(e,"audioTimingInfo")),t.on("videoTimingInfo",e.trigger.bind(e,"videoTimingInfo")),t.on("trackinfo",e.trigger.bind(e,"trackinfo")),t.on("id3Frame",function(i){i.dispatchType=t.metadataStream.dispatchType,i.cueTime=c.videoTsToSeconds(i.pts),e.trigger("id3Frame",i);}),t.on("caption",function(t){e.trigger("caption",t);});},y=function(t){var e=null,i=!0;t=t||{},y.prototype.init.call(this),t.baseMediaDecodeTime=t.baseMediaDecodeTime||0,this.push=function(n){if(i){var a=h(n);!a||e&&"aac"===e.type?a||e&&"ts"===e.type||(e=f(t),g(e,this)):(e=m(t),g(e,this)),i=!1;}e.headOfPipeline.push(n);},this.flush=function(){e&&(i=!0,e.headOfPipeline.flush());},this.partialFlush=function(){e&&e.headOfPipeline.partialFlush();},this.endTimeline=function(){e&&e.headOfPipeline.endTimeline();},this.reset=function(){e&&e.headOfPipeline.reset();},this.setBaseMediaDecodeTime=function(i){t.keepOriginalTimestamps||(t.baseMediaDecodeTime=i),e&&(e.tracks.audio&&(e.tracks.audio.timelineStartInfo.dts=void 0,e.tracks.audio.timelineStartInfo.pts=void 0,d.clearDtsInfo(e.tracks.audio),e.audioRollover&&e.audioRollover.discontinuity()),e.tracks.video&&(e.videoSegmentStream&&(e.videoSegmentStream.gopCache_=[]),e.tracks.video.timelineStartInfo.dts=void 0,e.tracks.video.timelineStartInfo.pts=void 0,d.clearDtsInfo(e.tracks.video)),e.timestampRollover&&e.timestampRollover.discontinuity());},this.setRemux=function(i){t.remux=i,e&&e.coalesceStream&&e.coalesceStream.setRemux(i);},this.setAudioAppendStart=function(t){e&&e.tracks.audio&&e.audioSegmentStream&&e.audioSegmentStream.setAudioAppendStart(t);},this.alignGopsWith=function(t){};};y.prototype=new n,e.exports=y;},{1:1,18:18,2:2,3:3,31:31,33:33,36:36,47:47,49:49,5:5}],36:[function(t,e,i){var n=t(49),a=t(28),r=t(31),s=t(26),o=t(7),d=function(t,e){var i,n,h,p=0,u=[],c=[],l=null,f=null,m=!0;e=e||{},d.prototype.init.call(this),this.push=function(e){r.collectDtsInfo(t,e),void 0===t.timelineStartInfo.dts&&(t.timelineStartInfo.dts=e.dts),"seq_parameter_set_rbsp"!==e.nalUnitType||i||(i=e.config,t.sps=[e.data],o.forEach(function(e){t[e]=i[e];},this)),"pic_parameter_set_rbsp"!==e.nalUnitType||n||(n=e.data,t.pps=[e.data]),u.push(e);},this.processNals_=function(i){var n;for(u=c.concat(u);u.length&&"access_unit_delimiter_rbsp"!==u[0].nalUnitType;)u.shift();if(0!==u.length){var o=s.groupNalsIntoFrames(u);if(o.length){if(c=o[o.length-1],i&&(o.pop(),o.duration-=c.duration,o.nalCount-=c.length,o.byteLength-=c.byteLength),!o.length)return void(u=[]);if(this.trigger("timelineStartInfo",t.timelineStartInfo),m){if(h=s.groupFramesIntoGops(o),!h[0][0].keyFrame){if(h=s.extendFirstKeyFrame(h),!h[0][0].keyFrame)return u=[].concat.apply([],o).concat(c),void(c=[]);o=[].concat.apply([],h),o.duration=h.duration;}m=!1;}for(null===l&&(l=o[0].pts,f=l),f+=o.duration,this.trigger("timingInfo",{start:l,end:f}),n=0;n<o.length;n++){var d=o[n];t.samples=s.generateSampleTableForFrame(d);var g=a.mdat(s.concatenateNalDataForFrame(d));r.clearDtsInfo(t),r.collectDtsInfo(t,d),t.baseMediaDecodeTime=r.calculateTrackBaseMediaDecodeTime(t,e.keepOriginalTimestamps);var y=a.moof(p,[t]);p++,t.initSegment=a.initSegment([t]);var b=new Uint8Array(y.byteLength+g.byteLength);b.set(y),b.set(g,y.byteLength),this.trigger("data",{track:t,boxes:b,sequence:p,videoFrameDts:d.dts,videoFramePts:d.pts});}u=[];}}},this.resetTimingAndConfig_=function(){i=void 0,n=void 0,l=null,f=null;},this.partialFlush=function(){this.processNals_(!0),this.trigger("partialdone","VideoSegmentStream");},this.flush=function(){this.processNals_(!1),this.resetTimingAndConfig_(),this.trigger("done","VideoSegmentStream");},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline","VideoSegmentStream");},this.reset=function(){this.resetTimingAndConfig_(),c=[],u=[],m=!0,this.trigger("reset");};};d.prototype=new n,e.exports=d;},{26:26,28:28,31:31,49:49,7:7}],37:[function(t,e,i){var n=function(t){for(var e=0,i={payloadType:-1,payloadSize:0},n=0,a=0;e<t.byteLength&&128!==t[e];){for(;255===t[e];)n+=255,e++;for(n+=t[e++];255===t[e];)a+=255,e++;if(a+=t[e++],!i.payload&&4===n){if("GA94"===String.fromCharCode(t[e+3],t[e+4],t[e+5],t[e+6])){i.payloadType=n,i.payloadSize=a,i.payload=t.subarray(e,e+a);break}i.payload=void 0;}e+=a,n=0,a=0;}return i},a=function(t){return 181!==t.payload[0]?null:49!=(t.payload[1]<<8|t.payload[2])?null:"GA94"!==String.fromCharCode(t.payload[3],t.payload[4],t.payload[5],t.payload[6])?null:3!==t.payload[7]?null:t.payload.subarray(8,t.payload.length-1)},r=function(t,e){var i,n,a,r,s=[];if(!(64&e[0]))return s;for(n=31&e[0],i=0;i<n;i++)a=3*i,r={type:3&e[a+2],pts:t},4&e[a+2]&&(r.ccData=e[a+3]<<8|e[a+4],s.push(r));return s},s=function(t){for(var e,i,n=t.byteLength,a=[],r=1;r<n-2;)0===t[r]&&0===t[r+1]&&3===t[r+2]?(a.push(r+2),r+=2):r++;if(0===a.length)return t;e=n-a.length,i=new Uint8Array(e);var s=0;for(r=0;r<e;s++,r++)s===a[0]&&(s++,a.shift()),i[r]=t[s];return i};e.exports={parseSei:n,parseUserData:a,parseCaptionPackets:r,discardEmulationPreventionBytes:s,USER_DATA_REGISTERED_ITU_T_T35:4};},{}],38:[function(t,e,i){var n={8:"audio",9:"video",18:"metadata"},a=function(t){return "0x"+("00"+t.toString(16)).slice(-2).toUpperCase()},r=function(t){for(var e,i=[];t.byteLength>0;)e=0,i.push(a(t[e++])),t=t.subarray(e);return i.join(" ")},s=function(t,e){var i=["AVC Sequence Header","AVC NALU","AVC End-of-Sequence"],n=t[1]&parseInt("01111111",2)<<16|t[2]<<8|t[3];return e=e||{},e.avcPacketType=i[t[0]],e.CompositionTime=t[1]&parseInt("10000000",2)?-n:n,1===t[0]?e.nalUnitTypeRaw=r(t.subarray(4,100)):e.data=r(t.subarray(4)),e},o=function(t,e){var i=["Unknown","Keyframe (for AVC, a seekable frame)","Inter frame (for AVC, a nonseekable frame)","Disposable inter frame (H.263 only)","Generated keyframe (reserved for server use only)","Video info/command frame"],n=t[0]&parseInt("00001111",2);return e=e||{},e.frameType=i[(t[0]&parseInt("11110000",2))>>>4],e.codecID=n,7===n?s(t.subarray(1),e):e},d=function(t,e){var i=["AAC Sequence Header","AAC Raw"];return e=e||{},e.aacPacketType=i[t[0]],e.data=r(t.subarray(1)),e},h=function(t,e){var i=["Linear PCM, platform endian","ADPCM","MP3","Linear PCM, little endian","Nellymoser 16-kHz mono","Nellymoser 8-kHz mono","Nellymoser","G.711 A-law logarithmic PCM","G.711 mu-law logarithmic PCM","reserved","AAC","Speex","MP3 8-Khz","Device-specific sound"],n=["5.5-kHz","11-kHz","22-kHz","44-kHz"],a=(t[0]&parseInt("11110000",2))>>>4;return e=e||{},e.soundFormat=i[a],e.soundRate=n[(t[0]&parseInt("00001100",2))>>>2],e.soundSize=(t[0]&parseInt("00000010",2))>>>1?"16-bit":"8-bit",e.soundType=t[0]&parseInt("00000001",2)?"Stereo":"Mono",10===a?d(t.subarray(1),e):e},p=function(t){return {tagType:n[t[0]],dataSize:t[1]<<16|t[2]<<8|t[3],timestamp:t[7]<<24|t[4]<<16|t[5]<<8|t[6],streamID:t[8]<<16|t[9]<<8|t[10]}},u=function(t){var e=p(t);switch(t[0]){case 8:h(t.subarray(11),e);break;case 9:o(t.subarray(11),e);}return e},c=function(t){var e,i,n=9,a=[];for(n+=4;n<t.byteLength;)e=t[n+1]<<16,e|=t[n+2]<<8,e|=t[n+3],e+=11,i=t.subarray(n,n+e),a.push(u(i)),n+=e+4;return a},l=function(t){return JSON.stringify(t,null,2)};e.exports={inspectTag:u,inspect:c,textify:l};},{}],39:[function(t,e,i){var n,a,r=function(t){return new Date(1e3*t-20828448e5)},s=t(29),o=t(25),d=function(t){var e,i,n=new DataView(t.buffer,t.byteOffset,t.byteLength),a=[];for(e=0;e+4<t.length;e+=i)if(i=n.getUint32(e),e+=4,i<=0)a.push("<span style='color:red;'>MALFORMED DATA</span>");else switch(31&t[e]){case 1:a.push("slice_layer_without_partitioning_rbsp");break;case 5:a.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:a.push("sei_rbsp");break;case 7:a.push("seq_parameter_set_rbsp");break;case 8:a.push("pic_parameter_set_rbsp");break;case 9:a.push("access_unit_delimiter_rbsp");break;default:a.push("UNKNOWN NAL - "+t[e]&31);}return a},h={avc1:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return {dataReferenceIndex:e.getUint16(6),width:e.getUint16(24),height:e.getUint16(26),horizresolution:e.getUint16(28)+e.getUint16(30)/16,vertresolution:e.getUint16(32)+e.getUint16(34)/16,frameCount:e.getUint16(40),depth:e.getUint16(74),config:n(t.subarray(78,t.byteLength))}},avcC:function(t){var e,i,n,a,r=new DataView(t.buffer,t.byteOffset,t.byteLength),s={configurationVersion:t[0],avcProfileIndication:t[1],profileCompatibility:t[2],avcLevelIndication:t[3],lengthSizeMinusOne:3&t[4],sps:[],pps:[]},o=31&t[5];for(n=6,a=0;a<o;a++)i=r.getUint16(n),n+=2,s.sps.push(new Uint8Array(t.subarray(n,n+i))),n+=i;for(e=t[n],n++,a=0;a<e;a++)i=r.getUint16(n),n+=2,s.pps.push(new Uint8Array(t.subarray(n,n+i))),n+=i;return s},btrt:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return {bufferSizeDB:e.getUint32(0),maxBitrate:e.getUint32(4),avgBitrate:e.getUint32(8)}},esds:function(t){return {version:t[0],flags:new Uint8Array(t.subarray(1,4)),esId:t[6]<<8|t[7],streamPriority:31&t[8],decoderConfig:{objectProfileIndication:t[11],streamType:t[12]>>>2&63,bufferSize:t[13]<<16|t[14]<<8|t[15],maxBitrate:t[16]<<24|t[17]<<16|t[18]<<8|t[19],avgBitrate:t[20]<<24|t[21]<<16|t[22]<<8|t[23],decoderConfigDescriptor:{tag:t[24],length:t[25],audioObjectType:t[26]>>>3&31,samplingFrequencyIndex:(7&t[26])<<1|t[27]>>>7&1,channelConfiguration:t[27]>>>3&15}}}},ftyp:function(t){for(var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={majorBrand:s(t.subarray(0,4)),minorVersion:e.getUint32(4),compatibleBrands:[]},n=8;n<t.byteLength;)i.compatibleBrands.push(s(t.subarray(n,n+4))),n+=4;return i},
    dinf:function(t){return {boxes:n(t)}},dref:function(t){return {version:t[0],flags:new Uint8Array(t.subarray(1,4)),dataReferences:n(t.subarray(8))}},hdlr:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),handlerType:s(t.subarray(8,12)),name:""},n=8;for(n=24;n<t.byteLength;n++){if(0===t[n]){n++;break}i.name+=String.fromCharCode(t[n]);}return i.name=decodeURIComponent(escape(i.name)),i},mdat:function(t){return {byteLength:t.byteLength,nals:d(t)}},mdhd:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=4,a={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),language:""};return 1===a.version?(n+=4,a.creationTime=r(i.getUint32(n)),n+=8,a.modificationTime=r(i.getUint32(n)),n+=4,a.timescale=i.getUint32(n),n+=8,a.duration=i.getUint32(n)):(a.creationTime=r(i.getUint32(n)),n+=4,a.modificationTime=r(i.getUint32(n)),n+=4,a.timescale=i.getUint32(n),n+=4,a.duration=i.getUint32(n)),n+=4,e=i.getUint16(n),a.language+=String.fromCharCode(96+(e>>10)),a.language+=String.fromCharCode(96+((992&e)>>5)),a.language+=String.fromCharCode(96+(31&e)),a},mdia:function(t){return {boxes:n(t)}},mfhd:function(t){return {version:t[0],flags:new Uint8Array(t.subarray(1,4)),sequenceNumber:t[4]<<24|t[5]<<16|t[6]<<8|t[7]}},minf:function(t){return {boxes:n(t)}},mp4a:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={dataReferenceIndex:e.getUint16(6),channelcount:e.getUint16(16),samplesize:e.getUint16(18),samplerate:e.getUint16(24)+e.getUint16(26)/65536};return t.byteLength>28&&(i.streamDescriptor=n(t.subarray(28))[0]),i},moof:function(t){return {boxes:n(t)}},moov:function(t){return {boxes:n(t)}},mvex:function(t){return {boxes:n(t)}},mvhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i=4,n={version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=r(e.getUint32(i)),i+=8,n.modificationTime=r(e.getUint32(i)),i+=4,n.timescale=e.getUint32(i),i+=8,n.duration=e.getUint32(i)):(n.creationTime=r(e.getUint32(i)),i+=4,n.modificationTime=r(e.getUint32(i)),i+=4,n.timescale=e.getUint32(i),i+=4,n.duration=e.getUint32(i)),i+=4,n.rate=e.getUint16(i)+e.getUint16(i+2)/16,i+=4,n.volume=e.getUint8(i)+e.getUint8(i+1)/8,i+=2,i+=2,i+=8,n.matrix=new Uint32Array(t.subarray(i,i+36)),i+=36,i+=24,n.nextTrackId=e.getUint32(i),n},pdin:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return {version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),rate:e.getUint32(4),initialDelay:e.getUint32(8)}},sdtp:function(t){var e,i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]};for(e=4;e<t.byteLength;e++)i.samples.push({dependsOn:(48&t[e])>>4,isDependedOn:(12&t[e])>>2,hasRedundancy:3&t[e]});return i},sidx:t(41),smhd:function(t){return {version:t[0],flags:new Uint8Array(t.subarray(1,4)),balance:t[4]+t[5]/256}},stbl:function(t){return {boxes:n(t)}},stco:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),chunkOffsets:[]},a=i.getUint32(4);for(e=8;a;e+=4,a--)n.chunkOffsets.push(i.getUint32(e));return n},stsc:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=i.getUint32(4),a={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleToChunks:[]};for(e=8;n;e+=12,n--)a.sampleToChunks.push({firstChunk:i.getUint32(e),samplesPerChunk:i.getUint32(e+4),sampleDescriptionIndex:i.getUint32(e+8)});return a},stsd:function(t){return {version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleDescriptions:n(t.subarray(8))}},stsz:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]};for(e=12;e<t.byteLength;e+=4)n.entries.push(i.getUint32(e));return n},stts:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),timeToSamples:[]},a=i.getUint32(4);for(e=8;a;e+=8,a--)n.timeToSamples.push({sampleCount:i.getUint32(e),sampleDelta:i.getUint32(e+4)});return n},styp:function(t){return h.ftyp(t)},tfdt:t(42),tfhd:t(43),tkhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i=4,n={version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=r(e.getUint32(i)),i+=8,n.modificationTime=r(e.getUint32(i)),i+=4,n.trackId=e.getUint32(i),i+=4,i+=8,n.duration=e.getUint32(i)):(n.creationTime=r(e.getUint32(i)),i+=4,n.modificationTime=r(e.getUint32(i)),i+=4,n.trackId=e.getUint32(i),i+=4,i+=4,n.duration=e.getUint32(i)),i+=4,i+=8,n.layer=e.getUint16(i),i+=2,n.alternateGroup=e.getUint16(i),i+=2,n.volume=e.getUint8(i)+e.getUint8(i+1)/8,i+=2,i+=2,n.matrix=new Uint32Array(t.subarray(i,i+36)),i+=36,n.width=e.getUint16(i)+e.getUint16(i+2)/65536,i+=4,n.height=e.getUint16(i)+e.getUint16(i+2)/65536,n},traf:function(t){return {boxes:n(t)}},trak:function(t){return {boxes:n(t)}},trex:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return {version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:e.getUint32(4),defaultSampleDescriptionIndex:e.getUint32(8),defaultSampleDuration:e.getUint32(12),defaultSampleSize:e.getUint32(16),sampleDependsOn:3&t[20],sampleIsDependedOn:(192&t[21])>>6,sampleHasRedundancy:(48&t[21])>>4,samplePaddingValue:(14&t[21])>>1,sampleIsDifferenceSample:!!(1&t[21]),sampleDegradationPriority:e.getUint16(22)}},trun:t(44),"url ":function(t){return {version:t[0],flags:new Uint8Array(t.subarray(1,4))}},vmhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return {version:t[0],flags:new Uint8Array(t.subarray(1,4)),graphicsmode:e.getUint16(4),opcolor:new Uint16Array([e.getUint16(6),e.getUint16(8),e.getUint16(10)])}}};n=function(t){for(var e,i,n,a,r,o=0,d=[],p=new ArrayBuffer(t.length),u=new Uint8Array(p),c=0;c<t.length;++c)u[c]=t[c];for(e=new DataView(p);o<t.byteLength;)i=e.getUint32(o),n=s(t.subarray(o+4,o+8)),a=i>1?o+i:t.byteLength,r=(h[n]||function(t){return {data:t}})(t.subarray(o+8,a)),r.size=i,r.type=n,d.push(r),o=a;return d},a=function(t,e){var i;return e=e||0,i=new Array(2*e+1).join(" "),t.map(function(t,n){return i+t.type+"\n"+Object.keys(t).filter(function(t){return "type"!==t&&"boxes"!==t}).map(function(e){var n=i+"  "+e+": ",a=t[e];if(a instanceof Uint8Array||a instanceof Uint32Array){var r=Array.prototype.slice.call(new Uint8Array(a.buffer,a.byteOffset,a.byteLength)).map(function(t){return " "+("00"+t.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return r?1===r.length?n+"<"+r.join("").slice(1)+">":n+"<\n"+r.map(function(t){return i+"  "+t}).join("\n")+"\n"+i+"  >":n+"<>"}return n+JSON.stringify(a,null,2).split("\n").map(function(t,e){return 0===e?t:i+"  "+t}).join("\n")}).join("\n")+(t.boxes?"\n"+a(t.boxes,e+1):"")}).join("\n")},e.exports={inspect:n,textify:a,parseType:s,findBox:o,parseTraf:h.traf,parseTfdt:h.tfdt,parseHdlr:h.hdlr,parseTfhd:h.tfhd,parseTrun:h.trun,parseSidx:h.sidx};},{25:25,29:29,41:41,42:42,43:43,44:44}],40:[function(t,e,i){var n=function(t){return {isLeading:(12&t[0])>>>2,dependsOn:3&t[0],isDependedOn:(192&t[1])>>>6,hasRedundancy:(48&t[1])>>>4,paddingValue:(14&t[1])>>>1,isNonSyncSample:1&t[1],degradationPriority:t[2]<<8|t[3]}};e.exports=n;},{}],41:[function(t,e,i){var n=Math.pow(2,32),a=function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:e.getUint32(4),timescale:e.getUint32(8)},a=12;0===i.version?(i.earliestPresentationTime=e.getUint32(a),i.firstOffset=e.getUint32(a+4),a+=8):(i.earliestPresentationTime=e.getUint32(a)*n+e.getUint32(a+4),i.firstOffset=e.getUint32(a+8)*n+e.getUint32(a+12),a+=16),a+=2;var r=e.getUint16(a);for(a+=2;r>0;a+=12,r--)i.references.push({referenceType:(128&t[a])>>>7,referencedSize:2147483647&e.getUint32(a),subsegmentDuration:e.getUint32(a+4),startsWithSap:!!(128&t[a+8]),sapType:(112&t[a+8])>>>4,sapDeltaTime:268435455&e.getUint32(a+8)});return i};e.exports=a;},{}],42:[function(t,e,i){var n=t(46).toUnsigned,a=function(t){var e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),baseMediaDecodeTime:n(t[4]<<24|t[5]<<16|t[6]<<8|t[7])};return 1===e.version&&(e.baseMediaDecodeTime*=Math.pow(2,32),e.baseMediaDecodeTime+=n(t[8]<<24|t[9]<<16|t[10]<<8|t[11])),e};e.exports=a;},{46:46}],43:[function(t,e,i){var n=function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:i.getUint32(4)},a=1&n.flags[2],r=2&n.flags[2],s=8&n.flags[2],o=16&n.flags[2],d=32&n.flags[2],h=65536&n.flags[0],p=131072&n.flags[0];return e=8,a&&(e+=4,n.baseDataOffset=i.getUint32(12),e+=4),r&&(n.sampleDescriptionIndex=i.getUint32(e),e+=4),s&&(n.defaultSampleDuration=i.getUint32(e),e+=4),o&&(n.defaultSampleSize=i.getUint32(e),e+=4),d&&(n.defaultSampleFlags=i.getUint32(e)),h&&(n.durationIsEmpty=!0),!a&&p&&(n.baseDataOffsetIsMoof=!0),n};e.exports=n;},{}],44:[function(t,e,i){var n=t(40),a=function(t){var e,i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},a=new DataView(t.buffer,t.byteOffset,t.byteLength),r=1&i.flags[2],s=4&i.flags[2],o=1&i.flags[1],d=2&i.flags[1],h=4&i.flags[1],p=8&i.flags[1],u=a.getUint32(4),c=8;for(r&&(i.dataOffset=a.getInt32(c),c+=4),s&&u&&(e={flags:n(t.subarray(c,c+4))},c+=4,o&&(e.duration=a.getUint32(c),c+=4),d&&(e.size=a.getUint32(c),c+=4),p&&(1===i.version?e.compositionTimeOffset=a.getInt32(c):e.compositionTimeOffset=a.getUint32(c),c+=4),i.samples.push(e),u--);u--;)e={},o&&(e.duration=a.getUint32(c),c+=4),d&&(e.size=a.getUint32(c),c+=4),h&&(e.flags=n(t.subarray(c,c+4)),c+=4),p&&(1===i.version?e.compositionTimeOffset=a.getInt32(c):e.compositionTimeOffset=a.getUint32(c),c+=4),i.samples.push(e);return i};e.exports=a;},{40:40}],45:[function(t,e,i){var n=t(21),a=t(22).handleRollover,r={};r.ts=t(20),r.aac=t(2);var s=t(47).ONE_SECOND_IN_TS,o=function(t,e){for(var i,n=0,a=188;a<t.byteLength;)if(71!==t[n]||71!==t[a])n++,a++;else {switch(i=t.subarray(n,a),r.ts.parseType(i,e.pid)){case"pat":e.pid||(e.pid=r.ts.parsePat(i));break;case"pmt":e.table||(e.table=r.ts.parsePmt(i));}if(e.pid&&e.table)return;n+=188,a+=188;}},d=function(t,e,i){for(var n,a,s,o,d=0,h=188,p=!1;h<=t.byteLength;)if(71!==t[d]||71!==t[h]&&h!==t.byteLength)d++,h++;else {switch(n=t.subarray(d,h),r.ts.parseType(n,e.pid)){case"pes":a=r.ts.parsePesType(n,e.table),s=r.ts.parsePayloadUnitStartIndicator(n),"audio"===a&&s&&(o=r.ts.parsePesTime(n))&&(o.type="audio",i.audio.push(o),p=!0);}if(p)break;d+=188,h+=188;}for(h=t.byteLength,d=h-188,p=!1;d>=0;)if(71!==t[d]||71!==t[h]&&h!==t.byteLength)d--,h--;else {switch(n=t.subarray(d,h),r.ts.parseType(n,e.pid)){case"pes":a=r.ts.parsePesType(n,e.table),s=r.ts.parsePayloadUnitStartIndicator(n),"audio"===a&&s&&(o=r.ts.parsePesTime(n))&&(o.type="audio",i.audio.push(o),p=!0);}if(p)break;d-=188,h-=188;}},h=function(t,e,i){for(var n,a,s,o,d,h,p,u=0,c=188,l=!1,f={data:[],size:0};c<t.byteLength;)if(71!==t[u]||71!==t[c])u++,c++;else {switch(n=t.subarray(u,c),r.ts.parseType(n,e.pid)){case"pes":if(a=r.ts.parsePesType(n,e.table),s=r.ts.parsePayloadUnitStartIndicator(n),"video"===a&&(s&&!l&&(o=r.ts.parsePesTime(n))&&(o.type="video",i.video.push(o),l=!0),!i.firstKeyFrame)){if(s&&0!==f.size){for(d=new Uint8Array(f.size),h=0;f.data.length;)p=f.data.shift(),d.set(p,h),h+=p.byteLength;if(r.ts.videoPacketContainsKeyFrame(d)){var m=r.ts.parsePesTime(d);m?(i.firstKeyFrame=m,i.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.");}f.size=0;}f.data.push(n),f.size+=n.byteLength;}}if(l&&i.firstKeyFrame)break;u+=188,c+=188;}for(c=t.byteLength,u=c-188,l=!1;u>=0;)if(71!==t[u]||71!==t[c])u--,c--;else {switch(n=t.subarray(u,c),r.ts.parseType(n,e.pid)){case"pes":a=r.ts.parsePesType(n,e.table),s=r.ts.parsePayloadUnitStartIndicator(n),"video"===a&&s&&(o=r.ts.parsePesTime(n))&&(o.type="video",i.video.push(o),l=!0);}if(l)break;u-=188,c-=188;}},p=function(t,e){if(t.audio&&t.audio.length){var i=e;void 0===i&&(i=t.audio[0].dts),t.audio.forEach(function(t){t.dts=a(t.dts,i),t.pts=a(t.pts,i),t.dtsTime=t.dts/s,t.ptsTime=t.pts/s;});}if(t.video&&t.video.length){var n=e;if(void 0===n&&(n=t.video[0].dts),t.video.forEach(function(t){t.dts=a(t.dts,n),t.pts=a(t.pts,n),t.dtsTime=t.dts/s,t.ptsTime=t.pts/s;}),t.firstKeyFrame){var r=t.firstKeyFrame;r.dts=a(r.dts,n),r.pts=a(r.pts,n),r.dtsTime=r.dts/s,r.ptsTime=r.dts/s;}}},u=function(t){for(var e,i=!1,n=0,a=null,o=null,d=0,h=0;t.length-h>=3;){switch(r.aac.parseType(t,h)){case"timed-metadata":if(t.length-h<10){i=!0;break}if((d=r.aac.parseId3TagSize(t,h))>t.length){i=!0;break}null===o&&(e=t.subarray(h,h+d),o=r.aac.parseAacTimestamp(e)),h+=d;break;case"audio":if(t.length-h<7){i=!0;break}if((d=r.aac.parseAdtsSize(t,h))>t.length){i=!0;break}null===a&&(e=t.subarray(h,h+d),a=r.aac.parseSampleRate(e)),n++,h+=d;break;default:h++;}if(i)return null}if(null===a||null===o)return null;var p=s/a;return {audio:[{type:"audio",dts:o,pts:o},{type:"audio",dts:o+1024*n*p,pts:o+1024*n*p}]}},c=function(t){var e={pid:null,table:null},i={};o(t,e);for(var a in e.table)if(e.table.hasOwnProperty(a)){var r=e.table[a];switch(r){case n.H264_STREAM_TYPE:i.video=[],h(t,e,i),0===i.video.length&&delete i.video;break;case n.ADTS_STREAM_TYPE:i.audio=[],d(t,e,i),0===i.audio.length&&delete i.audio;}}return i},l=function(t,e){var i,n=r.aac.isLikelyAacData(t);return (i=n?u(t):c(t))&&(i.audio||i.video)?(p(i,e),i):null};e.exports={inspect:l,parseAudioPes_:d};},{2:2,20:20,21:21,22:22,47:47}],46:[function(t,e,i){var n=function(t){return t>>>0},a=function(t){return ("00"+t.toString(16)).slice(-2)};e.exports={toUnsigned:n,toHexString:a};},{}],47:[function(t,e,i){var n,a,r,s,o,d,h;n=function(t){return 9e4*t},a=function(t,e){return t*e},r=function(t){return t/9e4},s=function(t,e){return t/e},o=function(t,e){return n(s(t,e))},d=function(t,e){return a(r(t),e)},h=function(t,e,i){return r(i?t:t-e)},e.exports={ONE_SECOND_IN_TS:9e4,secondsToVideoTs:n,secondsToAudioTs:a,videoTsToSeconds:r,audioTsToSeconds:s,audioTsToVideoTs:o,videoTsToAudioTs:d,metadataTsToSeconds:h};},{}],48:[function(t,e,i){var n;n=function(t){var e=t.byteLength,i=0,n=0;this.length=function(){return 8*e},this.bitsAvailable=function(){return 8*e+n},this.loadWord=function(){var a=t.byteLength-e,r=new Uint8Array(4),s=Math.min(4,e);if(0===s)throw new Error("no bytes available");r.set(t.subarray(a,a+s)),i=new DataView(r.buffer).getUint32(0),n=8*s,e-=s;},this.skipBits=function(t){var a;n>t?(i<<=t,n-=t):(t-=n,a=Math.floor(t/8),t-=8*a,e-=a,this.loadWord(),i<<=t,n-=t);},this.readBits=function(t){var a=Math.min(n,t),r=i>>>32-a;return n-=a,n>0?i<<=a:e>0&&this.loadWord(),a=t-a,a>0?r<<a|this.readBits(a):r},this.skipLeadingZeros=function(){var t;for(t=0;t<n;++t)if(0!=(i&2147483648>>>t))return i<<=t,n-=t,t;return this.loadWord(),t+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros());},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros());},this.readUnsignedExpGolomb=function(){var t=this.skipLeadingZeros();return this.readBits(t+1)-1},this.readExpGolomb=function(){var t=this.readUnsignedExpGolomb();return 1&t?1+t>>>1:-1*(t>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord();},e.exports=n;},{}],49:[function(t,e,i){var n=function(){this.init=function(){var t={};this.on=function(e,i){t[e]||(t[e]=[]),t[e]=t[e].concat(i);},this.off=function(e,i){var n;return !!t[e]&&(n=t[e].indexOf(i),t[e]=t[e].slice(),t[e].splice(n,1),n>-1)},this.trigger=function(e){var i,n,a,r;if(i=t[e])if(2===arguments.length)for(a=i.length,n=0;n<a;++n)i[n].call(this,arguments[1]);else {for(r=[],n=arguments.length,n=1;n<arguments.length;++n)r.push(arguments[n]);for(a=i.length,n=0;n<a;++n)i[n].apply(this,r);}},this.dispose=function(){t={};};};};n.prototype.pipe=function(t){return this.on("data",function(e){t.push(e);}),this.on("done",function(e){t.flush(e);}),this.on("partialdone",function(e){t.partialFlush(e);}),this.on("endedtimeline",function(e){t.endTimeline(e);}),this.on("reset",function(e){t.reset(e);}),t},n.prototype.push=function(t){this.trigger("data",t);},n.prototype.flush=function(t){this.trigger("done",t);},n.prototype.partialFlush=function(t){this.trigger("partialdone",t);},n.prototype.endTimeline=function(t){this.trigger("endedtimeline",t);},n.prototype.reset=function(t){this.trigger("reset",t);},e.exports=n;},{}]},{},[15])(15)});
    });

    const ProgressBarId = "progress-bar";
    const AudioTypes = ["mp3", "flac", "ogg", "wav"];

    function loadCss(href) {
      const link = document.createElement("link");
      link.href = href;
      link.type = "text/css";
      link.rel = "stylesheet";
      link.media = "screen,print";
      document.getElementsByTagName("head")[0].appendChild(link);
    }
    function secondToDate(seconds) {
      let h = Math.floor(seconds / 3600).toString();
      let m = Math.floor(seconds / 60 % 60).toString();
      let s = Math.floor(seconds % 60).toString();
      return `${h.padStart(2, "0")}:${m.padStart(2, "0")}:${s.padStart(2, "0")}`;
    }
    function getFileType(fname) {
      var parts = fname.split(".");
      if (parts.length <= 1) {
        return null;
      }
      return parts[parts.length - 1].toLowerCase();
    }
    function isAudio(name) {
      const filetype = getFileType(name);
      if (AudioTypes.indexOf(filetype) > -1) {
        return true;
      }
      return false;
    }

    var n,u,i,t,o,r,f={},e=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function s(n,l){for(var u in l)n[u]=l[u];return n}function a(n){var l=n.parentNode;l&&l.removeChild(n);}function v(n,l,u){var i,t,o,r=arguments,f={};for(o in l)"key"==o?i=l[o]:"ref"==o?t=l[o]:f[o]=l[o];if(arguments.length>3)for(u=[u],o=3;o<arguments.length;o++)u.push(r[o]);if(null!=u&&(f.children=u),"function"==typeof n&&null!=n.defaultProps)for(o in n.defaultProps)void 0===f[o]&&(f[o]=n.defaultProps[o]);return h(n,f,i,t,null)}function h(l,u,i,t,o){var r={type:l,props:u,key:i,ref:t,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++n.__v:o};return null!=n.vnode&&n.vnode(r),r}function y(){return {current:null}}function p(n){return n.children}function d(n,l){this.props=n,this.context=l;}function _(n,l){if(null==l)return n.__?_(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?_(n):null}function w(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return w(n)}}function k(l){(!l.__d&&(l.__d=!0)&&u.push(l)&&!g.__r++||t!==n.debounceRendering)&&((t=n.debounceRendering)||i)(g);}function g(){for(var n;g.__r=u.length;)n=u.sort(function(n,l){return n.__v.__b-l.__v.__b}),u=[],n.some(function(n){var l,u,i,t,o,r,f;n.__d&&(r=(o=(l=n).__v).__e,(f=l.__P)&&(u=[],(i=s({},o)).__v=o.__v+1,t=$(f,o,i,l.__n,void 0!==f.ownerSVGElement,null!=o.__h?[r]:null,u,null==r?_(o):r,o.__h),j(u,o),t!=r&&w(o)));});}function m(n,l,u,i,t,o,r,c,s,v){var y,d,w,k,g,m,b,A=i&&i.__k||e,P=A.length;for(s==f&&(s=null!=r?r[0]:P?_(i,0):null),u.__k=[],y=0;y<l.length;y++)if(null!=(k=u.__k[y]=null==(k=l[y])||"boolean"==typeof k?null:"string"==typeof k||"number"==typeof k?h(null,k,null,null,k):Array.isArray(k)?h(p,{children:k},null,null,null):null!=k.__e||null!=k.__c?h(k.type,k.props,k.key,null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(w=A[y])||w&&k.key==w.key&&k.type===w.type)A[y]=void 0;else for(d=0;d<P;d++){if((w=A[d])&&k.key==w.key&&k.type===w.type){A[d]=void 0;break}w=null;}g=$(n,k,w=w||f,t,o,r,c,s,v),(d=k.ref)&&w.ref!=d&&(b||(b=[]),w.ref&&b.push(w.ref,null,k),b.push(d,k.__c||g,k)),null!=g?(null==m&&(m=g),s=x(n,k,w,A,r,g,s),v||"option"!=u.type?"function"==typeof u.type&&(u.__d=s):n.value=""):s&&w.__e==s&&s.parentNode!=n&&(s=_(w));}if(u.__e=m,null!=r&&"function"!=typeof u.type)for(y=r.length;y--;)null!=r[y]&&a(r[y]);for(y=P;y--;)null!=A[y]&&L(A[y],A[y]);if(b)for(y=0;y<b.length;y++)I(b[y],b[++y],b[++y]);}function b(n,l){return l=l||[],null==n||"boolean"==typeof n||(Array.isArray(n)?n.some(function(n){b(n,l);}):l.push(n)),l}function x(n,l,u,i,t,o,r){var f,e,c;if(void 0!==l.__d)f=l.__d,l.__d=void 0;else if(t==u||o!=r||null==o.parentNode)n:if(null==r||r.parentNode!==n)n.appendChild(o),f=null;else {for(e=r,c=0;(e=e.nextSibling)&&c<i.length;c+=2)if(e==o)break n;n.insertBefore(o,r),f=r;}return void 0!==f?f:o.nextSibling}function A(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||C(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||C(n,o,l[o],u[o],i);}function P(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||c.test(l)?u:u+"px";}function C(n,l,u,i,t){var o,r,f;if(t&&"className"==l&&(l="class"),"style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||P(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||P(n.style,l,u[l]);}else "o"===l[0]&&"n"===l[1]?(o=l!==(l=l.replace(/Capture$/,"")),(r=l.toLowerCase())in n&&(l=r),l=l.slice(2),n.l||(n.l={}),n.l[l+o]=u,f=o?N:z,u?i||n.addEventListener(l,f,o):n.removeEventListener(l,f,o)):"list"!==l&&"tagName"!==l&&"form"!==l&&"type"!==l&&"size"!==l&&"download"!==l&&"href"!==l&&!t&&l in n?n[l]=null==u?"":u:"function"!=typeof u&&"dangerouslySetInnerHTML"!==l&&(l!==(l=l.replace(/xlink:?/,""))?null==u||!1===u?n.removeAttributeNS("http://www.w3.org/1999/xlink",l.toLowerCase()):n.setAttributeNS("http://www.w3.org/1999/xlink",l.toLowerCase(),u):null==u||!1===u&&!/^ar/.test(l)?n.removeAttribute(l):n.setAttribute(l,u));}function z(l){this.l[l.type+!1](n.event?n.event(l):l);}function N(l){this.l[l.type+!0](n.event?n.event(l):l);}function T(n,l,u){var i,t;for(i=0;i<n.__k.length;i++)(t=n.__k[i])&&(t.__=n,t.__e&&("function"==typeof t.type&&t.__k.length>1&&T(t,l,u),l=x(u,t,t,n.__k,null,t.__e,l),"function"==typeof n.type&&(n.__d=l)));}function $(l,u,i,t,o,r,f,e,c){var a,v,h,y,_,w,k,g,b,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(a=n.__b)&&a(u);try{n:if("function"==typeof P){if(g=u.props,b=(a=P.contextType)&&t[a.__c],x=a?b?b.props.value:a.__:t,i.__c?k=(v=u.__c=i.__c).__=v.__E:("prototype"in P&&P.prototype.render?u.__c=v=new P(g,x):(u.__c=v=new d(g,x),v.constructor=P,v.render=M),b&&b.sub(v),v.props=g,v.state||(v.state={}),v.context=x,v.__n=t,h=v.__d=!0,v.__h=[]),null==v.__s&&(v.__s=v.state),null!=P.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=s({},v.__s)),s(v.__s,P.getDerivedStateFromProps(g,v.__s))),y=v.props,_=v.state,h)null==P.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else {if(null==P.getDerivedStateFromProps&&g!==y&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(g,x),!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(g,v.__s,x)||u.__v===i.__v){v.props=g,v.state=v.__s,u.__v!==i.__v&&(v.__d=!1),v.__v=u,u.__e=i.__e,u.__k=i.__k,v.__h.length&&f.push(v),T(u,e,l);break n}null!=v.componentWillUpdate&&v.componentWillUpdate(g,v.__s,x),null!=v.componentDidUpdate&&v.__h.push(function(){v.componentDidUpdate(y,_,w);});}v.context=x,v.props=g,v.state=v.__s,(a=n.__r)&&a(u),v.__d=!1,v.__v=u,v.__P=l,a=v.render(v.props,v.state,v.context),v.state=v.__s,null!=v.getChildContext&&(t=s(s({},t),v.getChildContext())),h||null==v.getSnapshotBeforeUpdate||(w=v.getSnapshotBeforeUpdate(y,_)),A=null!=a&&a.type==p&&null==a.key?a.props.children:a,m(l,Array.isArray(A)?A:[A],u,i,t,o,r,f,e,c),v.base=u.__e,u.__h=null,v.__h.length&&f.push(v),k&&(v.__E=v.__=null),v.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=H(i.__e,u,i,t,o,r,f,c);(a=n.diffed)&&a(u);}catch(l){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),n.__e(l,u,i);}return u.__e}function j(l,u){n.__c&&n.__c(u,l),l.some(function(u){try{l=u.__h,u.__h=[],l.some(function(n){n.call(u);});}catch(l){n.__e(l,u.__v);}});}function H(n,l,u,i,t,o,r,c){var s,a,v,h,y,p=u.props,d=l.props;if(t="svg"===l.type||t,null!=o)for(s=0;s<o.length;s++)if(null!=(a=o[s])&&((null===l.type?3===a.nodeType:a.localName===l.type)||n==a)){n=a,o[s]=null;break}if(null==n){if(null===l.type)return document.createTextNode(d);n=t?document.createElementNS("http://www.w3.org/2000/svg",l.type):document.createElement(l.type,d.is&&{is:d.is}),o=null,c=!1;}if(null===l.type)p===d||c&&n.data===d||(n.data=d);else {if(null!=o&&(o=e.slice.call(n.childNodes)),v=(p=u.props||f).dangerouslySetInnerHTML,h=d.dangerouslySetInnerHTML,!c){if(null!=o)for(p={},y=0;y<n.attributes.length;y++)p[n.attributes[y].name]=n.attributes[y].value;(h||v)&&(h&&(v&&h.__html==v.__html||h.__html===n.innerHTML)||(n.innerHTML=h&&h.__html||""));}A(n,d,p,t,c),h?l.__k=[]:(s=l.props.children,m(n,Array.isArray(s)?s:[s],l,u,i,"foreignObject"!==l.type&&t,o,r,f,c)),c||("value"in d&&void 0!==(s=d.value)&&(s!==n.value||"progress"===l.type&&!s)&&C(n,"value",s,p.value,!1),"checked"in d&&void 0!==(s=d.checked)&&s!==n.checked&&C(n,"checked",s,p.checked,!1));}return n}function I(l,u,i){try{"function"==typeof l?l(u):l.current=u;}catch(l){n.__e(l,i);}}function L(l,u,i){var t,o,r;if(n.unmount&&n.unmount(l),(t=l.ref)&&(t.current&&t.current!==l.__e||I(t,null,u)),i||"function"==typeof l.type||(i=null!=(o=l.__e)),l.__e=l.__d=void 0,null!=(t=l.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(l){n.__e(l,u);}t.base=t.__P=null;}if(t=l.__k)for(r=0;r<t.length;r++)t[r]&&L(t[r],u,i);null!=o&&a(o);}function M(n,l,u){return this.constructor(n,u)}function O(l,u,i){var t,r,c;n.__&&n.__(l,u),r=(t=i===o)?null:i&&i.__k||u.__k,l=v(p,null,[l]),c=[],$(u,(t?u:i||u).__k=l,r||f,f,void 0!==u.ownerSVGElement,i&&!t?[i]:r?null:u.childNodes.length?e.slice.call(u.childNodes):null,c,i||f,t),j(c,l);}function S(n,l){O(n,l,o);}function q(n,l,u){var i,t,o,r=arguments,f=s({},n.props);for(o in l)"key"==o?i=l[o]:"ref"==o?t=l[o]:f[o]=l[o];if(arguments.length>3)for(u=[u],o=3;o<arguments.length;o++)u.push(r[o]);return null!=u&&(f.children=u),h(n.type,f,i||n.key,t||n.ref,null)}function B(n,l){var u={__c:l="__cC"+r++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n,u,i){return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(k);},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n);};}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n={__e:function(n,l){for(var u,i,t,o=l.__h;l=l.__;)if((u=l.__c)&&!u.__)try{if((i=u.constructor)&&null!=i.getDerivedStateFromError&&(u.setState(i.getDerivedStateFromError(n)),t=u.__d),null!=u.componentDidCatch&&(u.componentDidCatch(n),t=u.__d),t)return l.__h=o,u.__E=u}catch(l){n=l;}throw n},__v:0},d.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=s({},this.state),"function"==typeof n&&(n=n(s({},u),this.props)),n&&s(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),k(this));},d.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),k(this));},d.prototype.render=p,u=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g.__r=0,o=f,r=0;

    var n$1=function(t,s,r,e){var u;s[0]=0;for(var h=1;h<s.length;h++){var p=s[h++],a=s[h]?(s[0]|=p?1:2,r[s[h++]]):s[++h];3===p?e[0]=a:4===p?e[1]=Object.assign(e[1]||{},a):5===p?(e[1]=e[1]||{})[s[++h]]=a:6===p?e[1][s[++h]]+=a+"":p?(u=t.apply(a,n$1(t,a,r,["",null])),e.push(u),a[0]?s[0]|=2:(s[h-2]=0,s[h]=u)):e.push(a);}return e},t$1=new Map;function e$1(s){var r=t$1.get(this);return r||(r=new Map,t$1.set(this,r)),(r=n$1(this,r.get(s)||(r.set(s,r=function(n){for(var t,s,r=1,e="",u="",h=[0],p=function(n){1===r&&(n||(e=e.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?h.push(0,n,e):3===r&&(n||e)?(h.push(3,n,e),r=2):2===r&&"..."===e&&n?h.push(4,n,0):2===r&&e&&!n?h.push(5,0,!0,e):r>=5&&((e||!n&&5===r)&&(h.push(r,0,e,s),r=6),n&&(h.push(r,n,0,s),r=6)),e="";},a=0;a<n.length;a++){a&&(1===r&&p(),p(a));for(var l=0;l<n[a].length;l++)t=n[a][l],1===r?"<"===t?(p(),h=[h],r=3):e+=t:4===r?"--"===e&&">"===t?(r=1,e=""):e=t+e[0]:u?t===u?u="":e+=t:'"'===t||"'"===t?u=t:">"===t?(p(),r=1):r&&("="===t?(r=5,s=e,e=""):"/"===t&&(r<5||">"===n[a][l+1])?(p(),3===r&&(h=h[0]),r=h,(h=h[0]).push(2,0,r),r=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(p(),r=2):e+=t),3===r&&"!--"===e&&(r=4,h=h[0]);}return p(),h}(s)),r),arguments,[])).length>1?r:r[0]}

    var m$1=e$1.bind(v);

    /** @license React v16.13.1
     * react-is.production.min.js
     *
     * Copyright (c) Facebook, Inc. and its affiliates.
     *
     * This source code is licensed under the MIT license found in the
     * LICENSE file in the root directory of this source tree.
     */
    var b$1="function"===typeof Symbol&&Symbol.for,c$1=b$1?Symbol.for("react.element"):60103,d$1=b$1?Symbol.for("react.portal"):60106,e$2=b$1?Symbol.for("react.fragment"):60107,f$1=b$1?Symbol.for("react.strict_mode"):60108,g$1=b$1?Symbol.for("react.profiler"):60114,h$1=b$1?Symbol.for("react.provider"):60109,k$1=b$1?Symbol.for("react.context"):60110,l=b$1?Symbol.for("react.async_mode"):60111,m$2=b$1?Symbol.for("react.concurrent_mode"):60111,n$2=b$1?Symbol.for("react.forward_ref"):60112,p$1=b$1?Symbol.for("react.suspense"):60113,q$1=b$1?
    Symbol.for("react.suspense_list"):60120,r$1=b$1?Symbol.for("react.memo"):60115,t$2=b$1?Symbol.for("react.lazy"):60116,v$1=b$1?Symbol.for("react.block"):60121,w$1=b$1?Symbol.for("react.fundamental"):60117,x$1=b$1?Symbol.for("react.responder"):60118,y$1=b$1?Symbol.for("react.scope"):60119;
    function z$1(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c$1:switch(a=a.type,a){case l:case m$2:case e$2:case g$1:case f$1:case p$1:return a;default:switch(a=a&&a.$$typeof,a){case k$1:case n$2:case t$2:case r$1:case h$1:return a;default:return u}}case d$1:return u}}}function A$1(a){return z$1(a)===m$2}var AsyncMode=l;var ConcurrentMode=m$2;var ContextConsumer=k$1;var ContextProvider=h$1;var Element=c$1;var ForwardRef=n$2;var Fragment=e$2;var Lazy=t$2;var Memo=r$1;var Portal=d$1;
    var Profiler=g$1;var StrictMode=f$1;var Suspense=p$1;var isAsyncMode=function(a){return A$1(a)||z$1(a)===l};var isConcurrentMode=A$1;var isContextConsumer=function(a){return z$1(a)===k$1};var isContextProvider=function(a){return z$1(a)===h$1};var isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c$1};var isForwardRef=function(a){return z$1(a)===n$2};var isFragment=function(a){return z$1(a)===e$2};var isLazy=function(a){return z$1(a)===t$2};
    var isMemo=function(a){return z$1(a)===r$1};var isPortal=function(a){return z$1(a)===d$1};var isProfiler=function(a){return z$1(a)===g$1};var isStrictMode=function(a){return z$1(a)===f$1};var isSuspense=function(a){return z$1(a)===p$1};
    var isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e$2||a===m$2||a===g$1||a===f$1||a===p$1||a===q$1||"object"===typeof a&&null!==a&&(a.$$typeof===t$2||a.$$typeof===r$1||a.$$typeof===h$1||a.$$typeof===k$1||a.$$typeof===n$2||a.$$typeof===w$1||a.$$typeof===x$1||a.$$typeof===y$1||a.$$typeof===v$1)};var typeOf=z$1;

    var reactIs_production_min = {
    	AsyncMode: AsyncMode,
    	ConcurrentMode: ConcurrentMode,
    	ContextConsumer: ContextConsumer,
    	ContextProvider: ContextProvider,
    	Element: Element,
    	ForwardRef: ForwardRef,
    	Fragment: Fragment,
    	Lazy: Lazy,
    	Memo: Memo,
    	Portal: Portal,
    	Profiler: Profiler,
    	StrictMode: StrictMode,
    	Suspense: Suspense,
    	isAsyncMode: isAsyncMode,
    	isConcurrentMode: isConcurrentMode,
    	isContextConsumer: isContextConsumer,
    	isContextProvider: isContextProvider,
    	isElement: isElement,
    	isForwardRef: isForwardRef,
    	isFragment: isFragment,
    	isLazy: isLazy,
    	isMemo: isMemo,
    	isPortal: isPortal,
    	isProfiler: isProfiler,
    	isStrictMode: isStrictMode,
    	isSuspense: isSuspense,
    	isValidElementType: isValidElementType,
    	typeOf: typeOf
    };

    /** @license React v16.13.1
     * react-is.development.js
     *
     * Copyright (c) Facebook, Inc. and its affiliates.
     *
     * This source code is licensed under the MIT license found in the
     * LICENSE file in the root directory of this source tree.
     */

    var reactIs_development = createCommonjsModule(function (module, exports) {
    });

    var reactIs = createCommonjsModule(function (module) {

    {
      module.exports = reactIs_production_min;
    }
    });

    var t$3,u$1,r$2,o$1=0,i$1=[],c$2=n.__b,f$2=n.__r,e$3=n.diffed,a$1=n.__c,v$2=n.unmount;function m$3(t,r){n.__h&&n.__h(u$1,t,o$1||r),o$1=0;var i=u$1.__H||(u$1.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function l$1(n){return o$1=1,p$2(w$2,n)}function p$2(n,r,o){var i=m$3(t$3++,2);return i.t=n,i.__c||(i.__=[o?o(r):w$2(void 0,r),function(n){var t=i.t(i.__[0],n);i.__[0]!==t&&(i.__=[t,i.__[1]],i.__c.setState({}));}],i.__c=u$1),i.__}function y$2(r,o){var i=m$3(t$3++,3);!n.__s&&k$2(i.__H,o)&&(i.__=r,i.__H=o,u$1.__H.__h.push(i));}function h$2(r,o){var i=m$3(t$3++,4);!n.__s&&k$2(i.__H,o)&&(i.__=r,i.__H=o,u$1.__h.push(i));}function s$1(n){return o$1=5,d$2(function(){return {current:n}},[])}function _$1(n,t,u){o$1=6,h$2(function(){"function"==typeof n?n(t()):n&&(n.current=t());},null==u?u:u.concat(n));}function d$2(n,u){var r=m$3(t$3++,7);return k$2(r.__H,u)&&(r.__=n(),r.__H=u,r.__h=n),r.__}function A$2(n,t){return o$1=8,d$2(function(){return n},t)}function F(n){var r=u$1.context[n.__c],o=m$3(t$3++,9);return o.__c=n,r?(null==o.__&&(o.__=!0,r.sub(u$1)),r.props.value):n.__}function T$1(t,u){n.useDebugValue&&n.useDebugValue(u?u(t):t);}function x$2(){i$1.forEach(function(t){if(t.__P)try{t.__H.__h.forEach(g$2),t.__H.__h.forEach(j$1),t.__H.__h=[];}catch(u){t.__H.__h=[],n.__e(u,t.__v);}}),i$1=[];}n.__b=function(n){u$1=null,c$2&&c$2(n);},n.__r=function(n){f$2&&f$2(n),t$3=0;var r=(u$1=n.__c).__H;r&&(r.__h.forEach(g$2),r.__h.forEach(j$1),r.__h=[]);},n.diffed=function(t){e$3&&e$3(t);var o=t.__c;o&&o.__H&&o.__H.__h.length&&(1!==i$1.push(o)&&r$2===n.requestAnimationFrame||((r$2=n.requestAnimationFrame)||function(n){var t,u=function(){clearTimeout(r),b$2&&cancelAnimationFrame(t),setTimeout(n);},r=setTimeout(u,100);b$2&&(t=requestAnimationFrame(u));})(x$2)),u$1=void 0;},n.__c=function(t,u){u.some(function(t){try{t.__h.forEach(g$2),t.__h=t.__h.filter(function(n){return !n.__||j$1(n)});}catch(r){u.some(function(n){n.__h&&(n.__h=[]);}),u=[],n.__e(r,t.__v);}}),a$1&&a$1(t,u);},n.unmount=function(t){v$2&&v$2(t);var u=t.__c;if(u&&u.__H)try{u.__H.__.forEach(g$2);}catch(t){n.__e(t,u.__v);}};var b$2="function"==typeof requestAnimationFrame;function g$2(n){var t=u$1;"function"==typeof n.__c&&n.__c(),u$1=t;}function j$1(n){var t=u$1;n.__c=n.__(),u$1=t;}function k$2(n,t){return !n||n.length!==t.length||t.some(function(t,u){return t!==n[u]})}function w$2(n,t){return "function"==typeof t?t(n):t}

    function S$1(n,t){for(var e in t)n[e]=t[e];return n}function g$3(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function w$3(n){this.props=n;}function C$1(n,t){function e(n){var e=this.props.ref,r=e==n.ref;return !r&&e&&(e.call?e(null):e.current=null),t?!t(this.props,n)||!r:g$3(this.props,n)}function r(t){return this.shouldComponentUpdate=e,v(n,t)}return r.displayName="Memo("+(n.displayName||n.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(w$3.prototype=new d).isPureReactComponent=!0,w$3.prototype.shouldComponentUpdate=function(n,t){return g$3(this.props,n)||g$3(this.state,t)};var R=n.__b;n.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),R&&R(n);};var x$3="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function k$3(n){function t(t,e){var r=S$1({},t);return delete r.ref,n(r,(e=t.ref||e)&&("object"!=typeof e||"current"in e)?e:null)}return t.$$typeof=x$3,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var A$3=function(n,t){return null==n?null:b(b(n).map(t))},N$1={map:A$3,forEach:A$3,count:function(n){return n?b(n).length:0},only:function(n){var t=b(n);if(1!==t.length)throw "Children.only";return t[0]},toArray:b},O$1=n.__e;function L$1(n){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),n.__c.__H=null),(n=S$1({},n)).__c=null,n.__k=n.__k&&n.__k.map(L$1)),n}function U(n){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map(U)),n}function F$1(){this.__u=0,this.t=null,this.__b=null;}function M$1(n){var t=n.__.__c;return t&&t.__e&&t.__e(n)}function D(n){var t,e,r;function u(u){if(t||(t=n()).then(function(n){e=n.default||n;},function(n){r=n;}),r)throw r;if(!e)throw t;return v(e,u)}return u.displayName="Lazy",u.__f=!0,u}function I$1(){this.u=null,this.o=null;}n.__e=function(n,t,e){if(n.then)for(var r,u=t;u=u.__;)if((r=u.__c)&&r.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),r.__c(n,t);O$1(n,t,e);},(F$1.prototype=new d).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=M$1(r.__v),o=!1,i=function(){o||(o=!0,e.componentWillUnmount=e.__c,u?u(c):c());};e.__c=e.componentWillUnmount,e.componentWillUnmount=function(){i(),e.__c&&e.__c();};var c=function(){var n;if(!--r.__u)for(r.__v.__k[0]=U(r.state.__e),r.setState({__e:r.__b=null});n=r.t.pop();)n.forceUpdate();};!0===t.__h||r.__u++||r.setState({__e:r.__b=r.__v.__k[0]}),n.then(i,i);},F$1.prototype.componentWillUnmount=function(){this.t=[];},F$1.prototype.render=function(n,t){this.__b&&(this.__v.__k&&(this.__v.__k[0]=L$1(this.__b)),this.__b=null);var e=t.__e&&v(p,null,n.fallback);return e&&(e.__h=null),[v(p,null,t.__e?null:n.children),e]};var T$2=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};function W(n){return this.getChildContext=function(){return n.context},n.children}function j$2(n){var t=this,e=n.i,r=v(W,{context:t.context},n.__v);t.componentWillUnmount=function(){var n=t.l.parentNode;n&&n.removeChild(t.l),L(t.s);},t.i&&t.i!==e&&(t.componentWillUnmount(),t.h=!1),n.__v?t.h?(e.__k=t.__k,O(r,e),t.__k=e.__k):(t.l=document.createTextNode(""),t.__k=e.__k,S("",e),e.appendChild(t.l),t.h=!0,t.i=e,O(r,e,t.l),e.__k=t.__k,t.__k=t.l.__k):t.h&&t.componentWillUnmount(),t.s=r;}function P$1(n,t){return v(j$2,{__v:n,i:t})}(I$1.prototype=new d).__e=function(n){var t=this,e=M$1(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),T$2(t,n,r)):u();};e?e(o):o();}},I$1.prototype.render=function(n){this.u=null,this.o=new Map;var t=b(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},I$1.prototype.componentDidUpdate=I$1.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){T$2(n,e,t);});};var z$2="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,V=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,B$1="undefined"!=typeof Symbol?/fil|che|rad/i:/fil|che|ra/i;function H$1(n,t,e){return null==t.__k&&(t.textContent=""),O(n,t),"function"==typeof e&&e(),n?n.__c:null}function Z(n,t,e){return S(n,t),"function"==typeof e&&e(),n?n.__c:null}d.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(d.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t});}});});var Y=n.event;function $$1(){}function q$2(){return this.cancelBubble}function G(){return this.defaultPrevented}n.event=function(n){return Y&&(n=Y(n)),n.persist=$$1,n.isPropagationStopped=q$2,n.isDefaultPrevented=G,n.nativeEvent=n};var J,K={configurable:!0,get:function(){return this.class}},Q=n.vnode;n.vnode=function(n){var t=n.type,e=n.props,r=e;if("string"==typeof t){for(var u in r={},e){var o=e[u];"defaultValue"===u&&"value"in e&&null==e.value?u="value":"download"===u&&!0===o?o="":/ondoubleclick/i.test(u)?u="ondblclick":/^onchange(textarea|input)/i.test(u+t)&&!B$1.test(e.type)?u="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(u)?u=u.toLowerCase():V.test(u)?u=u.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===o&&(o=void 0),r[u]=o;}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=b(e.children).forEach(function(n){n.props.selected=-1!=r.value.indexOf(n.props.value);})),n.props=r;}t&&e.class!=e.className&&(K.enumerable="className"in e,null!=e.className&&(r.class=e.className),Object.defineProperty(r,"className",K)),n.$$typeof=z$2,Q&&Q(n);};var X=n.__r;n.__r=function(n){X&&X(n),J=n.__c;};var nn={ReactCurrentDispatcher:{current:{readContext:function(n){return J.__n[n.__c].props.value}}}};function en(n){return v.bind(null,n)}function rn(n){return !!n&&n.$$typeof===z$2}function un(n){return rn(n)?q.apply(null,arguments):n}function on(n){return !!n.__k&&(O(null,n),!0)}function cn(n){return n&&(n.base||1===n.nodeType&&n)||null}var ln=function(n,t){return n(t)};var r$3 = {useState:l$1,useReducer:p$2,useEffect:y$2,useLayoutEffect:h$2,useRef:s$1,useImperativeHandle:_$1,useMemo:d$2,useCallback:A$2,useContext:F,useDebugValue:T$1,version:"16.8.0",Children:N$1,render:H$1,hydrate:Z,unmountComponentAtNode:on,createPortal:P$1,createElement:v,createContext:B,createFactory:en,cloneElement:un,createRef:y,Fragment:p,isValidElement:rn,findDOMNode:cn,Component:d,PureComponent:w$3,memo:C$1,forwardRef:k$3,unstable_batchedUpdates:ln,StrictMode:p,Suspense:F$1,SuspenseList:I$1,lazy:D,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:nn};

    function stylis_min (W) {
      function M(d, c, e, h, a) {
        for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) {
          g = e.charCodeAt(l);
          l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++);

          if (0 === b + n + v + m) {
            if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) {
              switch (g) {
                case 32:
                case 9:
                case 59:
                case 13:
                case 10:
                  break;

                default:
                  f += e.charAt(l);
              }

              g = 59;
            }

            switch (g) {
              case 123:
                f = f.trim();
                q = f.charCodeAt(0);
                k = 1;

                for (t = ++l; l < B;) {
                  switch (g = e.charCodeAt(l)) {
                    case 123:
                      k++;
                      break;

                    case 125:
                      k--;
                      break;

                    case 47:
                      switch (g = e.charCodeAt(l + 1)) {
                        case 42:
                        case 47:
                          a: {
                            for (u = l + 1; u < J; ++u) {
                              switch (e.charCodeAt(u)) {
                                case 47:
                                  if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {
                                    l = u + 1;
                                    break a;
                                  }

                                  break;

                                case 10:
                                  if (47 === g) {
                                    l = u + 1;
                                    break a;
                                  }

                              }
                            }

                            l = u;
                          }

                      }

                      break;

                    case 91:
                      g++;

                    case 40:
                      g++;

                    case 34:
                    case 39:
                      for (; l++ < J && e.charCodeAt(l) !== g;) {
                      }

                  }

                  if (0 === k) break;
                  l++;
                }

                k = e.substring(t, l);
                0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0));

                switch (q) {
                  case 64:
                    0 < r && (f = f.replace(N, ''));
                    g = f.charCodeAt(1);

                    switch (g) {
                      case 100:
                      case 109:
                      case 115:
                      case 45:
                        r = c;
                        break;

                      default:
                        r = O;
                    }

                    k = M(c, r, k, g, a + 1);
                    t = k.length;
                    0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = ''));
                    if (0 < t) switch (g) {
                      case 115:
                        f = f.replace(da, ea);

                      case 100:
                      case 109:
                      case 45:
                        k = f + '{' + k + '}';
                        break;

                      case 107:
                        f = f.replace(fa, '$1 $2');
                        k = f + '{' + k + '}';
                        k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k;
                        break;

                      default:
                        k = f + k, 112 === h && (k = (p += k, ''));
                    } else k = '';
                    break;

                  default:
                    k = M(c, X(c, f, I), k, h, a + 1);
                }

                F += k;
                k = I = r = u = q = 0;
                f = '';
                g = e.charCodeAt(++l);
                break;

              case 125:
              case 59:
                f = (0 < r ? f.replace(N, '') : f).trim();
                if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\x00\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {
                  case 0:
                    break;

                  case 64:
                    if (105 === g || 99 === g) {
                      G += f + e.charAt(l);
                      break;
                    }

                  default:
                    58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));
                }
                I = r = u = q = 0;
                f = '';
                g = e.charCodeAt(++l);
            }
          }

          switch (g) {
            case 13:
            case 10:
              47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\x00');
              0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);
              z = 1;
              D++;
              break;

            case 59:
            case 125:
              if (0 === b + n + v + m) {
                z++;
                break;
              }

            default:
              z++;
              y = e.charAt(l);

              switch (g) {
                case 9:
                case 32:
                  if (0 === n + m + b) switch (x) {
                    case 44:
                    case 58:
                    case 9:
                    case 32:
                      y = '';
                      break;

                    default:
                      32 !== g && (y = ' ');
                  }
                  break;

                case 0:
                  y = '\\0';
                  break;

                case 12:
                  y = '\\f';
                  break;

                case 11:
                  y = '\\v';
                  break;

                case 38:
                  0 === n + b + m && (r = I = 1, y = '\f' + y);
                  break;

                case 108:
                  if (0 === n + b + m + E && 0 < u) switch (l - u) {
                    case 2:
                      112 === x && 58 === e.charCodeAt(l - 3) && (E = x);

                    case 8:
                      111 === K && (E = K);
                  }
                  break;

                case 58:
                  0 === n + b + m && (u = l);
                  break;

                case 44:
                  0 === b + v + n + m && (r = 1, y += '\r');
                  break;

                case 34:
                case 39:
                  0 === b && (n = n === g ? 0 : 0 === n ? g : n);
                  break;

                case 91:
                  0 === n + b + v && m++;
                  break;

                case 93:
                  0 === n + b + v && m--;
                  break;

                case 41:
                  0 === n + b + m && v--;
                  break;

                case 40:
                  if (0 === n + b + m) {
                    if (0 === q) switch (2 * x + 3 * K) {
                      case 533:
                        break;

                      default:
                        q = 1;
                    }
                    v++;
                  }

                  break;

                case 64:
                  0 === b + v + n + m + u + k && (k = 1);
                  break;

                case 42:
                case 47:
                  if (!(0 < n + m + v)) switch (b) {
                    case 0:
                      switch (2 * g + 3 * e.charCodeAt(l + 1)) {
                        case 235:
                          b = 47;
                          break;

                        case 220:
                          t = l, b = 42;
                      }

                      break;

                    case 42:
                      47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0);
                  }
              }

              0 === b && (f += y);
          }

          K = x;
          x = g;
          l++;
        }

        t = p.length;

        if (0 < t) {
          r = c;
          if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;
          p = r.join(',') + '{' + p + '}';

          if (0 !== w * E) {
            2 !== w || L(p, 2) || (E = 0);

            switch (E) {
              case 111:
                p = p.replace(ha, ':-moz-$1') + p;
                break;

              case 112:
                p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p;
            }

            E = 0;
          }
        }

        return G + p + F;
      }

      function X(d, c, e) {
        var h = c.trim().split(ia);
        c = h;
        var a = h.length,
            m = d.length;

        switch (m) {
          case 0:
          case 1:
            var b = 0;

            for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) {
              c[b] = Z(d, c[b], e).trim();
            }

            break;

          default:
            var v = b = 0;

            for (c = []; b < a; ++b) {
              for (var n = 0; n < m; ++n) {
                c[v++] = Z(d[n] + ' ', h[b], e).trim();
              }
            }

        }

        return c;
      }

      function Z(d, c, e) {
        var h = c.charCodeAt(0);
        33 > h && (h = (c = c.trim()).charCodeAt(0));

        switch (h) {
          case 38:
            return c.replace(F, '$1' + d.trim());

          case 58:
            return d.trim() + c.replace(F, '$1' + d.trim());

          default:
            if (0 < 1 * e && 0 < c.indexOf('\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim());
        }

        return d + c;
      }

      function P(d, c, e, h) {
        var a = d + ';',
            m = 2 * c + 3 * e + 4 * h;

        if (944 === m) {
          d = a.indexOf(':', 9) + 1;
          var b = a.substring(d, a.length - 1).trim();
          b = a.substring(0, d).trim() + b + ';';
          return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b;
        }

        if (0 === w || 2 === w && !L(a, 1)) return a;

        switch (m) {
          case 1015:
            return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a;

          case 951:
            return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a;

          case 963:
            return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a;

          case 1009:
            if (100 !== a.charCodeAt(4)) break;

          case 969:
          case 942:
            return '-webkit-' + a + a;

          case 978:
            return '-webkit-' + a + '-moz-' + a + a;

          case 1019:
          case 983:
            return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a;

          case 883:
            if (45 === a.charCodeAt(8)) return '-webkit-' + a + a;
            if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a;
            break;

          case 932:
            if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {
              case 103:
                return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a;

              case 115:
                return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a;

              case 98:
                return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a;
            }
            return '-webkit-' + a + '-ms-' + a + a;

          case 964:
            return '-webkit-' + a + '-ms-flex-' + a + a;

          case 1023:
            if (99 !== a.charCodeAt(8)) break;
            b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');
            return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a;

          case 1005:
            return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a;

          case 1e3:
            b = a.substring(13).trim();
            c = b.indexOf('-') + 1;

            switch (b.charCodeAt(0) + b.charCodeAt(c)) {
              case 226:
                b = a.replace(G, 'tb');
                break;

              case 232:
                b = a.replace(G, 'tb-rl');
                break;

              case 220:
                b = a.replace(G, 'lr');
                break;

              default:
                return a;
            }

            return '-webkit-' + a + '-ms-' + b + a;

          case 1017:
            if (-1 === a.indexOf('sticky', 9)) break;

          case 975:
            c = (a = d).length - 10;
            b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim();

            switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {
              case 203:
                if (111 > b.charCodeAt(8)) break;

              case 115:
                a = a.replace(b, '-webkit-' + b) + ';' + a;
                break;

              case 207:
              case 102:
                a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a;
            }

            return a + ';';

          case 938:
            if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {
              case 105:
                return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a;

              case 115:
                return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a;

              default:
                return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a;
            }
            break;

          case 973:
          case 989:
            if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;

          case 931:
          case 953:
            if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a;
            break;

          case 962:
            if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a;
        }

        return a;
      }

      function L(d, c) {
        var e = d.indexOf(1 === c ? ':' : '{'),
            h = d.substring(0, 3 !== c ? e : 10);
        e = d.substring(e + 1, d.length - 1);
        return R(2 !== c ? h : h.replace(na, '$1'), e, c);
      }

      function ea(d, c) {
        var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));
        return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')';
      }

      function H(d, c, e, h, a, m, b, v, n, q) {
        for (var g = 0, x = c, w; g < A; ++g) {
          switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {
            case void 0:
            case !1:
            case !0:
            case null:
              break;

            default:
              x = w;
          }
        }

        if (x !== c) return x;
      }

      function T(d) {
        switch (d) {
          case void 0:
          case null:
            A = S.length = 0;
            break;

          default:
            if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) {
              T(d[c]);
            } else Y = !!d | 0;
        }

        return T;
      }

      function U(d) {
        d = d.prefix;
        void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);
        return U;
      }

      function B(d, c) {
        var e = d;
        33 > e.charCodeAt(0) && (e = e.trim());
        V = e;
        e = [V];

        if (0 < A) {
          var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);
          void 0 !== h && 'string' === typeof h && (c = h);
        }

        var a = M(O, e, c, 0, 0);
        0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));
        V = '';
        E = 0;
        z = D = 1;
        return a;
      }

      var ca = /^\0+/g,
          N = /[\0\r\f]/g,
          aa = /: */g,
          ka = /zoo|gra/,
          ma = /([,: ])(transform)/g,
          ia = /,\r+?/g,
          F = /([\t\r\n ])*\f?&/g,
          fa = /@(k\w+)\s*(\S*)\s*/,
          Q = /::(place)/g,
          ha = /:(read-only)/g,
          G = /[svh]\w+-[tblr]{2}/,
          da = /\(\s*(.*)\s*\)/g,
          oa = /([\s\S]*?);/g,
          ba = /-self|flex-/g,
          na = /[^]*?(:[rp][el]a[\w-]+)[^]*/,
          la = /stretch|:\s*\w+\-(?:conte|avail)/,
          ja = /([^-])(image-set\()/,
          z = 1,
          D = 1,
          E = 0,
          w = 1,
          O = [],
          S = [],
          A = 0,
          R = null,
          Y = 0,
          V = '';
      B.use = T;
      B.set = U;
      void 0 !== W && U(W);
      return B;
    }

    var unitlessKeys = {
      animationIterationCount: 1,
      borderImageOutset: 1,
      borderImageSlice: 1,
      borderImageWidth: 1,
      boxFlex: 1,
      boxFlexGroup: 1,
      boxOrdinalGroup: 1,
      columnCount: 1,
      columns: 1,
      flex: 1,
      flexGrow: 1,
      flexPositive: 1,
      flexShrink: 1,
      flexNegative: 1,
      flexOrder: 1,
      gridRow: 1,
      gridRowEnd: 1,
      gridRowSpan: 1,
      gridRowStart: 1,
      gridColumn: 1,
      gridColumnEnd: 1,
      gridColumnSpan: 1,
      gridColumnStart: 1,
      msGridRow: 1,
      msGridRowSpan: 1,
      msGridColumn: 1,
      msGridColumnSpan: 1,
      fontWeight: 1,
      lineHeight: 1,
      opacity: 1,
      order: 1,
      orphans: 1,
      tabSize: 1,
      widows: 1,
      zIndex: 1,
      zoom: 1,
      WebkitLineClamp: 1,
      // SVG-related properties
      fillOpacity: 1,
      floodOpacity: 1,
      stopOpacity: 1,
      strokeDasharray: 1,
      strokeDashoffset: 1,
      strokeMiterlimit: 1,
      strokeOpacity: 1,
      strokeWidth: 1
    };

    function memoize(fn) {
      var cache = {};
      return function (arg) {
        if (cache[arg] === undefined) cache[arg] = fn(arg);
        return cache[arg];
      };
    }

    var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23

    var index = memoize(function (prop) {
      return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
      /* o */
      && prop.charCodeAt(1) === 110
      /* n */
      && prop.charCodeAt(2) < 91;
    }
    /* Z+1 */
    );

    /**
     * Copyright 2015, Yahoo! Inc.
     * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
     */
    var REACT_STATICS = {
      childContextTypes: true,
      contextType: true,
      contextTypes: true,
      defaultProps: true,
      displayName: true,
      getDefaultProps: true,
      getDerivedStateFromError: true,
      getDerivedStateFromProps: true,
      mixins: true,
      propTypes: true,
      type: true
    };
    var KNOWN_STATICS = {
      name: true,
      length: true,
      prototype: true,
      caller: true,
      callee: true,
      arguments: true,
      arity: true
    };
    var FORWARD_REF_STATICS = {
      '$$typeof': true,
      render: true,
      defaultProps: true,
      displayName: true,
      propTypes: true
    };
    var MEMO_STATICS = {
      '$$typeof': true,
      compare: true,
      defaultProps: true,
      displayName: true,
      propTypes: true,
      type: true
    };
    var TYPE_STATICS = {};
    TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
    TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;

    function getStatics(component) {
      // React v16.11 and below
      if (reactIs.isMemo(component)) {
        return MEMO_STATICS;
      } // React v16.12 and above


      return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
    }

    var defineProperty = Object.defineProperty;
    var getOwnPropertyNames = Object.getOwnPropertyNames;
    var getOwnPropertySymbols = Object.getOwnPropertySymbols;
    var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
    var getPrototypeOf = Object.getPrototypeOf;
    var objectPrototype = Object.prototype;
    function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
      if (typeof sourceComponent !== 'string') {
        // don't hoist over string (html) components
        if (objectPrototype) {
          var inheritedComponent = getPrototypeOf(sourceComponent);

          if (inheritedComponent && inheritedComponent !== objectPrototype) {
            hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
          }
        }

        var keys = getOwnPropertyNames(sourceComponent);

        if (getOwnPropertySymbols) {
          keys = keys.concat(getOwnPropertySymbols(sourceComponent));
        }

        var targetStatics = getStatics(targetComponent);
        var sourceStatics = getStatics(sourceComponent);

        for (var i = 0; i < keys.length; ++i) {
          var key = keys[i];

          if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
            var descriptor = getOwnPropertyDescriptor(sourceComponent, key);

            try {
              // Avoid failures from read-only properties
              defineProperty(targetComponent, key, descriptor);
            } catch (e) {}
          }
        }
      }

      return targetComponent;
    }

    var hoistNonReactStatics_cjs = hoistNonReactStatics;

    function v$3(){return (v$3=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);}return e}).apply(this,arguments)}var y$3=function(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n},g$4=function(t){return null!==t&&"object"==typeof t&&"[object Object]"===(t.toString?t.toString():Object.prototype.toString.call(t))&&!reactIs.typeOf(t)},S$2=Object.freeze([]),w$4=Object.freeze({});function E(e){return "function"==typeof e}function b$3(e){return e.displayName||e.name||"Component"}function N$2(e){return e&&"string"==typeof e.styledComponentId}var _$2="undefined"!=typeof process&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",A$4="undefined"!=typeof window&&"HTMLElement"in window,I$2=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!=="production"),P$2={};function D$1(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):""))}var j$3=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e;}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&D$1(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0;}for(var i=this.indexOfGroup(e+1),a=0,c=t.length;a<c;a++)this.tag.insertRule(i,t[a])&&(this.groupSizes[e]++,i++);},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n);}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s<o;s++)t+=this.tag.getRule(s)+"/*!sc*/\n";return t},e}(),T$3=new Map,x$4=new Map,k$4=1,V$1=function(e){if(T$3.has(e))return T$3.get(e);for(;x$4.has(k$4);)k$4++;var t=k$4++;return T$3.set(e,t),x$4.set(t,e),t},M$2=function(e){return x$4.get(e)},B$2=function(e,t){T$3.set(e,t),x$4.set(t,e);},z$3="style["+_$2+'][data-styled-version="5.2.1"]',L$2=new RegExp("^"+_$2+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),G$1=function(e,t,n){for(var r,o=n.split(","),s=0,i=o.length;s<i;s++)(r=o[s])&&e.registerName(t,r);},F$2=function(e,t){for(var n=t.innerHTML.split("/*!sc*/\n"),r=[],o=0,s=n.length;o<s;o++){var i=n[o].trim();if(i){var a=i.match(L$2);if(a){var c=0|parseInt(a[1],10),u=a[2];0!==c&&(B$2(u,c),G$1(e,u,a[3]),e.getTag().insertRules(c,r)),r.length=0;}else r.push(i);}}},Y$1=function(){return "undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null},q$3=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(_$2))return r}}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(_$2,"active"),r.setAttribute("data-styled-version","5.2.1");var i=Y$1();return i&&r.setAttribute("nonce",i),n.insertBefore(r,s),r},H$2=function(){function e(e){var t=this.element=q$3(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}D$1(17);}(t),this.length=0;}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return !1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--;},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),$$2=function(){function e(e){var t=this.element=q$3(e);this.nodes=t.childNodes,this.length=0;}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return !1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--;},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),W$1=function(){function e(e){this.rules=[],this.length=0;}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--;},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),U$1=A$4,J$1={isServer:!A$4,useCSSOMInjection:!I$2},Z$1=function(){function e(e,t,n){void 0===e&&(e=w$4),void 0===t&&(t={}),this.options=v$3({},J$1,{},e),this.gs=t,this.names=new Map(n),!this.options.isServer&&A$4&&U$1&&(U$1=!1,function(e){for(var t=document.querySelectorAll(z$3),n=0,r=t.length;n<r;n++){var o=t[n];o&&"active"!==o.getAttribute(_$2)&&(F$2(e,o),o.parentNode&&o.parentNode.removeChild(o));}}(this));}e.registerId=function(e){return V$1(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(v$3({},this.options,{},t),this.gs,n&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(n=(t=this.options).isServer,r=t.useCSSOMInjection,o=t.target,e=n?new W$1(o):r?new H$2(o):new $$2(o),new j$3(e)));var e,t,n,r,o;},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(V$1(e),this.names.has(e))this.names.get(e).add(t);else {var n=new Set;n.add(t),this.names.set(e,n);}},t.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(V$1(e),n);},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear();},t.clearRules=function(e){this.getTag().clearGroup(V$1(e)),this.clearNames(e);},t.clearTag=function(){this.tag=void 0;},t.toString=function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=0;o<n;o++){var s=M$2(o);if(void 0!==s){var i=e.names.get(s),a=t.getGroup(o);if(void 0!==i&&0!==a.length){var c=_$2+".g"+o+'[id="'+s+'"]',u="";void 0!==i&&i.forEach((function(e){e.length>0&&(u+=e+",");})),r+=""+a+c+'{content:"'+u+'"}/*!sc*/\n';}}}return r}(this)},e}(),X$1=/(a)(d)/gi,K$1=function(e){return String.fromCharCode(e+(e>25?39:97))};function Q$1(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=K$1(t%52)+n;return (K$1(t%52)+n).replace(X$1,"$1-$2")}var ee=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},te=function(e){return ee(5381,e)};function ne(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(E(n)&&!N$2(n))return !1}return !0}var re=te("5.2.1"),oe=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&ne(e),this.componentId=t,this.baseHash=ee(re,t),this.baseStyle=n,Z$1.registerId(t);}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,n)),this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(r,this.staticRulesId))o.push(this.staticRulesId);else {var s=Ne(this.rules,e,t,n).join(""),i=Q$1(ee(this.baseHash,s.length)>>>0);if(!t.hasNameForId(r,i)){var a=n(s,"."+i,void 0,r);t.insertRules(r,i,a);}o.push(i),this.staticRulesId=i;}else {for(var c=this.rules.length,u=ee(this.baseHash,n.hash),l="",d=0;d<c;d++){var h=this.rules[d];if("string"==typeof h)l+=h,"production"!=="production";else if(h){var p=Ne(h,e,t,n),f=Array.isArray(p)?p.join(""):p;u=ee(u,f+d),l+=f;}}if(l){var m=Q$1(u>>>0);if(!t.hasNameForId(r,m)){var v=n(l,"."+m,void 0,r);t.insertRules(r,m,v);}o.push(m);}}return o.join(" ")},e}(),se=/^\s*\/\/.*$/gm,ie=[":","[",".","#"];function ae(e){var t,n,r,o,s=void 0===e?w$4:e,i=s.options,a=void 0===i?w$4:i,c=s.plugins,u=void 0===c?S$2:c,l=new stylis_min(a),d=[],p=function(e){function t(t){if(t)try{e(t+"}");}catch(e){}}return function(n,r,o,s,i,a,c,u,l,d){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(o[0]+r),"";default:return r+(0===d?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t);}}}((function(e){d.push(e);})),f=function(e,r,s){return 0===r&&ie.includes(s[n.length])||s.match(o)?e:"."+t};function m(e,s,i,a){void 0===a&&(a="&");var c=e.replace(se,""),u=s&&i?i+" "+s+" { "+c+" }":c;return t=a,n=s,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),l(i||!s?"":s,u)}return l.use([].concat(u,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,f));},p,function(e){if(-2===e){var t=d;return d=[],t}}])),m.hash=u.length?u.reduce((function(e,t){return t.name||D$1(15),ee(e,t.name)}),5381).toString():"",m}var ce=r$3.createContext(),ue=ce.Consumer,le=r$3.createContext(),de=(le.Consumer,new Z$1),he=ae();function pe(){return F(ce)||de}function fe(){return F(le)||he}var ve=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=he);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"));},this.toString=function(){return D$1(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t;}return e.prototype.getName=function(e){return void 0===e&&(e=he),this.name+e.hash},e}(),ye=/([A-Z])/,ge=/([A-Z])/g,Se=/^ms-/,we=function(e){return "-"+e.toLowerCase()};function Ee(e){return ye.test(e)?e.replace(ge,we).replace(Se,"-ms-"):e}var be=function(e){return null==e||!1===e||""===e};function Ne(e,n,r,o){if(Array.isArray(e)){for(var s,i=[],a=0,c=e.length;a<c;a+=1)""!==(s=Ne(e[a],n,r,o))&&(Array.isArray(s)?i.push.apply(i,s):i.push(s));return i}if(be(e))return "";if(N$2(e))return "."+e.styledComponentId;if(E(e)){if("function"!=typeof(l=e)||l.prototype&&l.prototype.isReactComponent||!n)return e;var u=e(n);return Ne(u,n,r,o)}var l;return e instanceof ve?r?(e.inject(r,o),e.getName(o)):e:g$4(e)?function e(t,n){var r,o,s=[];for(var i in t)t.hasOwnProperty(i)&&!be(t[i])&&(g$4(t[i])?s.push.apply(s,e(t[i],i)):E(t[i])?s.push(Ee(i)+":",t[i],";"):s.push(Ee(i)+": "+(r=i,null==(o=t[i])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||r in unitlessKeys?String(o).trim():o+"px")+";"));return n?[n+" {"].concat(s,["}"]):s}(e):e.toString()}function _e(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return E(e)||g$4(e)?Ne(y$3(S$2,[e].concat(n))):0===n.length&&1===e.length&&"string"==typeof e[0]?e:Ne(y$3(e,n))}var Pe=function(e,t,n){return void 0===n&&(n=w$4),e.theme!==n.theme&&e.theme||t||n.theme},Oe=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Re=/(^-|-$)/g;function De(e){return e.replace(Oe,"-").replace(Re,"")}var je=function(e){return Q$1(te(e)>>>0)};function Te(e){return "string"==typeof e&&("production"==="production")}var xe=function(e){return "function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},ke=function(e){return "__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Ve(e,t,n){var r=e[n];xe(t)&&xe(r)?Me(r,t):e[n]=t;}function Me(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o=0,s=n;o<s.length;o++){var i=s[o];if(xe(i))for(var a in i)ke(a)&&Ve(e,i[a],a);}return e}var Be=r$3.createContext(),ze=Be.Consumer;var Ge={};function Fe(e,t,n){var o=N$2(e),i=!Te(e),a=t.attrs,c=void 0===a?S$2:a,d=t.componentId,h=void 0===d?function(e,t){var n="string"!=typeof e?"sc":De(e);Ge[n]=(Ge[n]||0)+1;var r=n+"-"+je("5.2.1"+n+Ge[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):d,p=t.displayName,y=void 0===p?function(e){return Te(e)?"styled."+e:"Styled("+b$3(e)+")"}(e):p,g=t.displayName&&t.componentId?De(t.displayName)+"-"+t.componentId:t.componentId||h,_=o&&e.attrs?Array.prototype.concat(e.attrs,c).filter(Boolean):c,C=t.shouldForwardProp;o&&e.shouldForwardProp&&(C=t.shouldForwardProp?function(n,r){return e.shouldForwardProp(n,r)&&t.shouldForwardProp(n,r)}:e.shouldForwardProp);var A,I=new oe(n,g,o?e.componentStyle:void 0),P=I.isStatic&&0===c.length,O=function(e,t){return function(e,t,n,r){var o=e.attrs,i=e.componentStyle,a=e.defaultProps,c=e.foldedComponentIds,d=e.shouldForwardProp,h=e.styledComponentId,p=e.target;var m=function(e,t,n){void 0===e&&(e=w$4);var r=v$3({},t,{theme:e}),o={};return n.forEach((function(e){var t,n,s,i=e;for(t in E(i)&&(i=i(r)),i)r[t]=o[t]="className"===t?(n=o[t],s=i[t],n&&s?n+" "+s:n||s):i[t];})),[r,o]}(Pe(t,F(Be),a)||w$4,t,o),y=m[0],g=m[1],S=function(e,t,n,r){var o=pe(),s=fe(),i=t?e.generateAndInjectStyles(w$4,o,s):e.generateAndInjectStyles(n,o,s);return i}(i,r,y),b=n,N=g.$as||t.$as||g.as||t.as||p,_=Te(N),C=g!==t?v$3({},t,{},g):t,A={};for(var I in C)"$"!==I[0]&&"as"!==I&&("forwardedAs"===I?A.as=C[I]:(d?d(I,index):!_||index(I))&&(A[I]=C[I]));return t.style&&g.style!==t.style&&(A.style=v$3({},t.style,{},g.style)),A.className=Array.prototype.concat(c,h,S!==h?S:null,t.className,g.className).filter(Boolean).join(" "),A.ref=b,v(N,A)}(A,e,t,P)};return O.displayName=y,(A=r$3.forwardRef(O)).attrs=_,A.componentStyle=I,A.displayName=y,A.shouldForwardProp=C,A.foldedComponentIds=o?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):S$2,A.styledComponentId=g,A.target=o?e.target:e,A.withComponent=function(e){var r=t.componentId,o=function(e,t){if(null==e)return {};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(t,["componentId"]),s=r&&r+"-"+(Te(e)?e:De(b$3(e)));return Fe(e,v$3({},o,{attrs:_,componentId:s}),n)},Object.defineProperty(A,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=o?Me({},e.defaultProps,t):t;}}),A.toString=function(){return "."+A.styledComponentId},i&&hoistNonReactStatics_cjs(A,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),A}var Ye=function(e){return function e(t,r,o){if(void 0===o&&(o=w$4),!reactIs.isValidElementType(r))return D$1(1,String(r));var s=function(){return t(r,o,_e.apply(void 0,arguments))};return s.withConfig=function(n){return e(t,r,v$3({},o,{},n))},s.attrs=function(n){return e(t,r,v$3({},o,{attrs:Array.prototype.concat(o.attrs,n).filter(Boolean)}))},s}(Fe,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){Ye[e]=Ye(e);}));var qe=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=ne(e),Z$1.registerId(this.componentId+1);}var t=e.prototype;return t.createStyles=function(e,t,n,r){var o=r(Ne(this.rules,t,n,r).join(""),""),s=this.componentId+e;n.insertRules(s,s,o);},t.removeStyles=function(e,t){t.clearRules(this.componentId+e);},t.renderStyles=function(e,t,n,r){e>2&&Z$1.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r);},e}();function He(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i=_e.apply(void 0,[e].concat(n)),a="sc-global-"+je(JSON.stringify(i)),u=new qe(i,a);function l(e){var t=pe(),n=fe(),o=F(Be),u=s$1(t.allocateGSInstance(a)).current;return d(u,e,t,o,n),null}function d(e,t,n,r,o){if(u.isStatic)u.renderStyles(e,P$2,n,o);else {var s=v$3({},t,{theme:Pe(t,r,l.defaultProps)});u.renderStyles(e,s,n,o);}}return r$3.memo(l)}

    var Events2 = {
      PlayerReady: "Player.Ready",
      PlayerTimeUpdate: "Player.TimeUpdate",
      PlayerPlay: "Player.Play",
      PlayerStop: "Player.Stop",
      PlayerRate: "Player.Rate",
      PlayerSpeed: "Player.Speed",
      PlayerLock: "Player.Lock",
      PlayerMenu: "Player.Menu",
      PlayerBack: "Player.Back",
      PlayerSeek: "Player.Seek",
      PlayerSize: "Player.Size",
      PlayerScale: "Player.Scale",
      PlayerVolume: "Player.Volume",
      PlayerLight: "Player.Light",
      PlayerExit: "Player.Exit",
      PlayerGoVip: "Player.GoVip",
      PlayerTitle: "Player.Title",
      PlayerRates: "Player.Rates",
      PlayerCount: "Player.Count",
      PlayerStart: "Player.Start",
      PlayerRender: "Player.Render",
      PlayerData: "Player.Data",
      PlayerLoadNext: "Player.LoadNext",
      PlayerEnd: "Player.End",
      PlayerWait: "Player.Wait",
      PlayerDelay: "Player.Delay",
      PlayerInited: "Player.Inited",
      PlayerLoadDone: "Player.LoadDone",
      PlayerReset: "Player.Reset",
      PlayerBufferUpdate: "Player.BufferUpdate",
      PlayerSeeked: "Player.seeked",
      PlayerMaxPTS: "Player.maxPTS",
      PlayerMaxAPids: "Player.maxAudioPids",
      AudioPlayerDataReady: "Audio.ready",
      AudioPlayerEnd: "Audio.end",
      AudioPlaySuccess: "Audio.success",
      AudioPlayFail: "Audio.fail",
      DecodeDone: "DecodeDone",
      DemuxedAAC: "DemuxedAAC",
      DecodeFlush: "DecodeFlush",
      ImagePlayerReady: "ImagePlayerReady",
      ImagePlayerBuffeUpdate: "ImagePlayerBuffeUpdate"
    };

    const img = "";

    const img$1 = "";

    /**
     * Checks if `value` is the
     * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
     * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an object, else `false`.
     * @example
     *
     * _.isObject({});
     * // => true
     *
     * _.isObject([1, 2, 3]);
     * // => true
     *
     * _.isObject(_.noop);
     * // => true
     *
     * _.isObject(null);
     * // => false
     */
    function isObject(value) {
      var type = typeof value;
      return value != null && (type == 'object' || type == 'function');
    }

    var isObject_1 = isObject;

    /** Detect free variable `global` from Node.js. */

    var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;

    var _freeGlobal = freeGlobal;

    /** Detect free variable `self`. */
    var freeSelf = typeof self == 'object' && self && self.Object === Object && self;

    /** Used as a reference to the global object. */
    var root = _freeGlobal || freeSelf || Function('return this')();

    var _root = root;

    /**
     * Gets the timestamp of the number of milliseconds that have elapsed since
     * the Unix epoch (1 January 1970 00:00:00 UTC).
     *
     * @static
     * @memberOf _
     * @since 2.4.0
     * @category Date
     * @returns {number} Returns the timestamp.
     * @example
     *
     * _.defer(function(stamp) {
     *   console.log(_.now() - stamp);
     * }, _.now());
     * // => Logs the number of milliseconds it took for the deferred invocation.
     */
    var now = function() {
      return _root.Date.now();
    };

    var now_1 = now;

    /** Built-in value references. */
    var Symbol$1 = _root.Symbol;

    var _Symbol = Symbol$1;

    /** Used for built-in method references. */
    var objectProto = Object.prototype;

    /** Used to check objects for own properties. */
    var hasOwnProperty = objectProto.hasOwnProperty;

    /**
     * Used to resolve the
     * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
     * of values.
     */
    var nativeObjectToString = objectProto.toString;

    /** Built-in value references. */
    var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;

    /**
     * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
     *
     * @private
     * @param {*} value The value to query.
     * @returns {string} Returns the raw `toStringTag`.
     */
    function getRawTag(value) {
      var isOwn = hasOwnProperty.call(value, symToStringTag),
          tag = value[symToStringTag];

      try {
        value[symToStringTag] = undefined;
        var unmasked = true;
      } catch (e) {}

      var result = nativeObjectToString.call(value);
      if (unmasked) {
        if (isOwn) {
          value[symToStringTag] = tag;
        } else {
          delete value[symToStringTag];
        }
      }
      return result;
    }

    var _getRawTag = getRawTag;

    /** Used for built-in method references. */
    var objectProto$1 = Object.prototype;

    /**
     * Used to resolve the
     * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
     * of values.
     */
    var nativeObjectToString$1 = objectProto$1.toString;

    /**
     * Converts `value` to a string using `Object.prototype.toString`.
     *
     * @private
     * @param {*} value The value to convert.
     * @returns {string} Returns the converted string.
     */
    function objectToString(value) {
      return nativeObjectToString$1.call(value);
    }

    var _objectToString = objectToString;

    /** `Object#toString` result references. */
    var nullTag = '[object Null]',
        undefinedTag = '[object Undefined]';

    /** Built-in value references. */
    var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;

    /**
     * The base implementation of `getTag` without fallbacks for buggy environments.
     *
     * @private
     * @param {*} value The value to query.
     * @returns {string} Returns the `toStringTag`.
     */
    function baseGetTag(value) {
      if (value == null) {
        return value === undefined ? undefinedTag : nullTag;
      }
      return (symToStringTag$1 && symToStringTag$1 in Object(value))
        ? _getRawTag(value)
        : _objectToString(value);
    }

    var _baseGetTag = baseGetTag;

    /**
     * Checks if `value` is object-like. A value is object-like if it's not `null`
     * and has a `typeof` result of "object".
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
     * @example
     *
     * _.isObjectLike({});
     * // => true
     *
     * _.isObjectLike([1, 2, 3]);
     * // => true
     *
     * _.isObjectLike(_.noop);
     * // => false
     *
     * _.isObjectLike(null);
     * // => false
     */
    function isObjectLike(value) {
      return value != null && typeof value == 'object';
    }

    var isObjectLike_1 = isObjectLike;

    /** `Object#toString` result references. */
    var symbolTag = '[object Symbol]';

    /**
     * Checks if `value` is classified as a `Symbol` primitive or object.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
     * @example
     *
     * _.isSymbol(Symbol.iterator);
     * // => true
     *
     * _.isSymbol('abc');
     * // => false
     */
    function isSymbol(value) {
      return typeof value == 'symbol' ||
        (isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
    }

    var isSymbol_1 = isSymbol;

    /** Used as references for various `Number` constants. */
    var NAN = 0 / 0;

    /** Used to match leading and trailing whitespace. */
    var reTrim = /^\s+|\s+$/g;

    /** Used to detect bad signed hexadecimal string values. */
    var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;

    /** Used to detect binary string values. */
    var reIsBinary = /^0b[01]+$/i;

    /** Used to detect octal string values. */
    var reIsOctal = /^0o[0-7]+$/i;

    /** Built-in method references without a dependency on `root`. */
    var freeParseInt = parseInt;

    /**
     * Converts `value` to a number.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to process.
     * @returns {number} Returns the number.
     * @example
     *
     * _.toNumber(3.2);
     * // => 3.2
     *
     * _.toNumber(Number.MIN_VALUE);
     * // => 5e-324
     *
     * _.toNumber(Infinity);
     * // => Infinity
     *
     * _.toNumber('3.2');
     * // => 3.2
     */
    function toNumber(value) {
      if (typeof value == 'number') {
        return value;
      }
      if (isSymbol_1(value)) {
        return NAN;
      }
      if (isObject_1(value)) {
        var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
        value = isObject_1(other) ? (other + '') : other;
      }
      if (typeof value != 'string') {
        return value === 0 ? value : +value;
      }
      value = value.replace(reTrim, '');
      var isBinary = reIsBinary.test(value);
      return (isBinary || reIsOctal.test(value))
        ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
        : (reIsBadHex.test(value) ? NAN : +value);
    }

    var toNumber_1 = toNumber;

    /** Error message constants. */
    var FUNC_ERROR_TEXT = 'Expected a function';

    /* Built-in method references for those with the same name as other `lodash` methods. */
    var nativeMax = Math.max,
        nativeMin = Math.min;

    /**
     * Creates a debounced function that delays invoking `func` until after `wait`
     * milliseconds have elapsed since the last time the debounced function was
     * invoked. The debounced function comes with a `cancel` method to cancel
     * delayed `func` invocations and a `flush` method to immediately invoke them.
     * Provide `options` to indicate whether `func` should be invoked on the
     * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
     * with the last arguments provided to the debounced function. Subsequent
     * calls to the debounced function return the result of the last `func`
     * invocation.
     *
     * **Note:** If `leading` and `trailing` options are `true`, `func` is
     * invoked on the trailing edge of the timeout only if the debounced function
     * is invoked more than once during the `wait` timeout.
     *
     * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
     * until to the next tick, similar to `setTimeout` with a timeout of `0`.
     *
     * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
     * for details over the differences between `_.debounce` and `_.throttle`.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Function
     * @param {Function} func The function to debounce.
     * @param {number} [wait=0] The number of milliseconds to delay.
     * @param {Object} [options={}] The options object.
     * @param {boolean} [options.leading=false]
     *  Specify invoking on the leading edge of the timeout.
     * @param {number} [options.maxWait]
     *  The maximum time `func` is allowed to be delayed before it's invoked.
     * @param {boolean} [options.trailing=true]
     *  Specify invoking on the trailing edge of the timeout.
     * @returns {Function} Returns the new debounced function.
     * @example
     *
     * // Avoid costly calculations while the window size is in flux.
     * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
     *
     * // Invoke `sendMail` when clicked, debouncing subsequent calls.
     * jQuery(element).on('click', _.debounce(sendMail, 300, {
     *   'leading': true,
     *   'trailing': false
     * }));
     *
     * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
     * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
     * var source = new EventSource('/stream');
     * jQuery(source).on('message', debounced);
     *
     * // Cancel the trailing debounced invocation.
     * jQuery(window).on('popstate', debounced.cancel);
     */
    function debounce(func, wait, options) {
      var lastArgs,
          lastThis,
          maxWait,
          result,
          timerId,
          lastCallTime,
          lastInvokeTime = 0,
          leading = false,
          maxing = false,
          trailing = true;

      if (typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      wait = toNumber_1(wait) || 0;
      if (isObject_1(options)) {
        leading = !!options.leading;
        maxing = 'maxWait' in options;
        maxWait = maxing ? nativeMax(toNumber_1(options.maxWait) || 0, wait) : maxWait;
        trailing = 'trailing' in options ? !!options.trailing : trailing;
      }

      function invokeFunc(time) {
        var args = lastArgs,
            thisArg = lastThis;

        lastArgs = lastThis = undefined;
        lastInvokeTime = time;
        result = func.apply(thisArg, args);
        return result;
      }

      function leadingEdge(time) {
        // Reset any `maxWait` timer.
        lastInvokeTime = time;
        // Start the timer for the trailing edge.
        timerId = setTimeout(timerExpired, wait);
        // Invoke the leading edge.
        return leading ? invokeFunc(time) : result;
      }

      function remainingWait(time) {
        var timeSinceLastCall = time - lastCallTime,
            timeSinceLastInvoke = time - lastInvokeTime,
            timeWaiting = wait - timeSinceLastCall;

        return maxing
          ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
          : timeWaiting;
      }

      function shouldInvoke(time) {
        var timeSinceLastCall = time - lastCallTime,
            timeSinceLastInvoke = time - lastInvokeTime;

        // Either this is the first call, activity has stopped and we're at the
        // trailing edge, the system time has gone backwards and we're treating
        // it as the trailing edge, or we've hit the `maxWait` limit.
        return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
          (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
      }

      function timerExpired() {
        var time = now_1();
        if (shouldInvoke(time)) {
          return trailingEdge(time);
        }
        // Restart the timer.
        timerId = setTimeout(timerExpired, remainingWait(time));
      }

      function trailingEdge(time) {
        timerId = undefined;

        // Only invoke if we have `lastArgs` which means `func` has been
        // debounced at least once.
        if (trailing && lastArgs) {
          return invokeFunc(time);
        }
        lastArgs = lastThis = undefined;
        return result;
      }

      function cancel() {
        if (timerId !== undefined) {
          clearTimeout(timerId);
        }
        lastInvokeTime = 0;
        lastArgs = lastCallTime = lastThis = timerId = undefined;
      }

      function flush() {
        return timerId === undefined ? result : trailingEdge(now_1());
      }

      function debounced() {
        var time = now_1(),
            isInvoking = shouldInvoke(time);

        lastArgs = arguments;
        lastThis = this;
        lastCallTime = time;

        if (isInvoking) {
          if (timerId === undefined) {
            return leadingEdge(lastCallTime);
          }
          if (maxing) {
            // Handle invocations in a tight loop.
            clearTimeout(timerId);
            timerId = setTimeout(timerExpired, wait);
            return invokeFunc(lastCallTime);
          }
        }
        if (timerId === undefined) {
          timerId = setTimeout(timerExpired, wait);
        }
        return result;
      }
      debounced.cancel = cancel;
      debounced.flush = flush;
      return debounced;
    }

    var debounce_1 = debounce;

    /** Error message constants. */
    var FUNC_ERROR_TEXT$1 = 'Expected a function';

    /**
     * Creates a throttled function that only invokes `func` at most once per
     * every `wait` milliseconds. The throttled function comes with a `cancel`
     * method to cancel delayed `func` invocations and a `flush` method to
     * immediately invoke them. Provide `options` to indicate whether `func`
     * should be invoked on the leading and/or trailing edge of the `wait`
     * timeout. The `func` is invoked with the last arguments provided to the
     * throttled function. Subsequent calls to the throttled function return the
     * result of the last `func` invocation.
     *
     * **Note:** If `leading` and `trailing` options are `true`, `func` is
     * invoked on the trailing edge of the timeout only if the throttled function
     * is invoked more than once during the `wait` timeout.
     *
     * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
     * until to the next tick, similar to `setTimeout` with a timeout of `0`.
     *
     * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
     * for details over the differences between `_.throttle` and `_.debounce`.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Function
     * @param {Function} func The function to throttle.
     * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
     * @param {Object} [options={}] The options object.
     * @param {boolean} [options.leading=true]
     *  Specify invoking on the leading edge of the timeout.
     * @param {boolean} [options.trailing=true]
     *  Specify invoking on the trailing edge of the timeout.
     * @returns {Function} Returns the new throttled function.
     * @example
     *
     * // Avoid excessively updating the position while scrolling.
     * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
     *
     * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
     * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
     * jQuery(element).on('click', throttled);
     *
     * // Cancel the trailing throttled invocation.
     * jQuery(window).on('popstate', throttled.cancel);
     */
    function throttle(func, wait, options) {
      var leading = true,
          trailing = true;

      if (typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT$1);
      }
      if (isObject_1(options)) {
        leading = 'leading' in options ? !!options.leading : leading;
        trailing = 'trailing' in options ? !!options.trailing : trailing;
      }
      return debounce_1(func, wait, {
        'leading': leading,
        'maxWait': wait,
        'trailing': trailing
      });
    }

    var throttle_1 = throttle;

    const GlobalStyle = He`
  html, body {
    font: 14px/1.21 'Helvetica Neue', arial, sans-serif;
    font-weight: 400;
    background: #000;
    color: #fff;
    margin: 0;
    padding: 0;
    border: none;
  }
  * {
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  #player {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
  }
`;
    const App = Ye.div`
  font-family: sans-serif;
  font-size: 16px;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  .xlp-lock,
  .xlp-locked {
    position: absolute;
    right: 30px;
    top: 50%;
    margin-top: -20px;
    font-size: 22px;
  }
`;
    const Banner = Ye.div`
  position: absolute;
  top: 20px;
  left: 0;
  width: 100%;
  height: 40px;
  padding: 0 32px;
  box-sizing: border-box;
  z-index: 1;
  display: flex;
  align-items: center;
  .menu-bar {
    width: 40px;
    height: 40px;
    margin-left: auto;
  }
  .xlp-more {
    font-size: 12px;
    transform: scale(.5);
  }
`;
    const Btn = Ye.a`
  color: ${(props) => `${props.color || "#FFF"}`};
  width: 40px;
  height: 40px;
  display: ${(props) => `${props.hide ? "none" : "flex"}`};
  align-items: center;
  justify-content: center;
  margin: ${(props) => props.margin ? `${props.margin}` : "0"};
`;
    const Title = Ye.div`
  font-size: 16px;
  color: #FFFFFF;
  width: 60%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
`;
    const Speeds = Ye.div`
  width: 160px;
  height: 100vh;
  background: rgba(0,0,0,.8);
  position: absolute;
  top: 0;
  right: 0;
  transition: transform .2s linear;
  display: flex;
  flex-direction: column;
  transform: ${(props) => props.show ? "translate3d(0,0,0)" : "translate3d(160px,0,0)"};
  z-index: 2;
  padding: 20px 16px;
  box-sizing: border-box;
`;
    const Speed = Ye.div`
  height: 60px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: ${(props) => props.on ? "#68CBF8" : "#fff"};
`;
    const RateTip = Ye.div`
  height: 60px;
  display: flex;
  font-size: 12px;
  color: #949BA5;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #50555E;
`;
    const Progress = Ye.div`
  position: absolute;
  bottom: 50px;
  width: 100%;
  left: 0;
  display: flex;
  padding: 0 32px;
  box-sizing: border-box;
  align-items: center;
`;
    const Timer = Ye.div`
  font-size: 12px;
  color: #FFFFFF;
`;
    const ProgressBar = Ye.div`
  flex: 1;
  margin: 0 14px;
  background: rgba(255,255,255,.2);
  height: 3px;
  position: relative;
  border-radius: 2px;
  cursor: pointer;
`;
    const ProgressBarCache = Ye.div`
  position: absolute;
  left: 0;
  width: ${(props) => `${props.width}%`};
  height: 100%;
  background: rgba(255,255,255,.4);
  border-radius: 2px;
`;
    const ProgressBarCurrent = Ye.div`
  position: absolute;
  left: 0;
  width: ${(props) => `${props.width}%`};
  height: 100%;
  background: linear-gradient(to right, #0050FF, #00CCFF);
  border-radius: 2px;
`;
    const ProgressBarDot = Ye.div`
  position: absolute;
  // left: 0;
  bottom: -5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  // transform: ${(props) => `translate3d(${props.left}%, 0, 0)`};
  left: ${(props) => `${props.left}%`};
`;
    const Controls = Ye.div`
  padding: 0 32px 10px 0;
  position: absolute;
  width: 100%;
  box-sizing: border-box;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #FFFFFF;
  background-image: linear-gradient(to top, rgba(0,0,0,0.60) 0%, rgba(0,0,0,0.00) 100%);
`;
    const RateBtn = Ye.div`
  margin-left: auto;
`;
    const SpeedBtn = Ye.div`
  margin-left: 20px;
`;
    const ScreenBox = Ye.div`
  width: 292px;
  height: 100vh;
  font-size: 14px;
  color: #949BA5;
  background: rgba(0,0,0,.8);
  position: absolute;
  top: 0;
  right: 0;
  transition: transform .2s linear;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform: ${(props) => props.show ? "translate3d(0,0,0)" : "translate3d(292px,0,0)"};
  z-index: 2;
  box-sizing: border-box;
  padding-left: 30px;
`;
    const ScreenSizeBtn = Ye.span`
  background: rgba(255,255,255,.15);
  border-radius: 12.5px;
  text-align: center;
  padding: 0 9px;
  height: 25px;
  line-height: 25px;
  margin-right: 13px;
  display: inline-block;
  color: ${(props) => props.on ? "#68CBF8" : "#fff"}
`;
    const ScreenLoad = Ye.div`
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: ${(props) => props.show ? "flex" : "none"};
  justify-content: center;
  align-items: center;
  flex-direction: column;
`;
    const ScreenLoadImg = Ye.div`
  width: 48px;
  height: 48px;
  display: inline-block;
  background-image: url("${img}");
  background-size: 100% 100%;
  animation: rotate 1.4s linear infinite;
  @keyframes rotate {
    0% {
      transform: rotate(0);
    }
    100% {
      transform: rotate(360deg);
    }
  }
`;
    const ScreenLoadTip = Ye.p`
  font-size: 12px;
  color: #FFFFFF;
  text-align: center;
  line-height: 17px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.50);
`;
    const FloatBar = Ye.div`
  position: absolute;
  top: 30%;
  left: 10%;
  width: 158px;
  height: 32px;
  border-radius: 16px;
  background: rgba(0,0,0,0.40);
  display: ${(props) => props.show ? "flex" : "none"};
  align-items: center;
  padding-left: 10px;
  box-sizing: border-box;
  .iconfont {
    width: 24px;
    height: 24px;
  }
`;
    const FloatBarRange = Ye.p`
  width: 100px;
  height: 2px;
  background: rgba(255,255,255,.2);
  border-radius: 1px;
  position: relative;
`;
    const FloatBarRangeCurrent = Ye.p`
  width: ${(props) => `${props.width}%`};
  height: 2px;
  background: rgba(255,255,255,1);
  border-radius: 1px;
  position: absolute;
  left: 0;
  top: 0;
`;
    const TipJiaSu = Ye.div`
  border: 1px solid #F1C86A;
  border-radius: 20px;
  font-size: 12px;
  height: 24px;
  line-height: 24px;
  color: #F1C86A;
  padding: 0px 10px 0 6px;
  display: ${(props) => `${props.show ? "flex" : "none"}`};
  align-items: center;
  .iconfont {
    color: #F1C86A;
    width: 16px;
    height: 100%;
  }
`;
    const TipPlayCountJiaSU = Ye.div`
  position: absolute;
  top: 200px;
  left: 26px;
  display: flex;
  flex-direction: column;
  width: 230px;
  height: 48px;
  border-radius: 24px;
  background-color: rgba(0,0,0,.7);
  background-image: url("${img$1}");
  background-size: 24px 24px;
  background-position: 10px 10px;
  background-repeat: no-repeat;
  padding-left: 42px;
  justify-content: center;
  box-sizing: border-box;
  transition: opacity .4s linear;
  opacity: ${(props) => props.show ? 1 : 0};
  p {
    font-size: 14px;
    color: #FFDD8D;
    a {
      color: #60BBE5;
    }
  }
`;
    const SpeedList = ["2.0", "1.5", "1.25", "1.0", "0.75", "0.5"];
    const RateList = ["\u65E0\u635F 4K", "\u8D85\u6E05 1080p", "\u9AD8\u6E05 720p", "\u6D41\u7545 480p"];
    const ScreenSizeBtns = ["100", "75", "50"];
    const ScreenScaleBtns = ["\u81EA\u9002\u5E94", "\u5168\u5C4F\u62C9\u4F38", "\u653E\u5927\u88C1\u526A"];
    var TouchType;
    (function(TouchType2) {
      TouchType2[TouchType2["light"] = 0] = "light";
      TouchType2[TouchType2["volume"] = 1] = "volume";
    })(TouchType || (TouchType = {}));
    let touchData = {
      type: 0,
      start: false,
      x: 0,
      y: 0,
      num: 0
    };
    let windowInnerWidth = 0;
    let windowInnerHeight = 0;
    class Player extends d {
      constructor() {
        super(...arguments);
        this.state = {
          title: "",
          loading: true,
          current: secondToDate(0),
          duration: secondToDate(0),
          currentRate: 0,
          currentCache: 0,
          rate: 0,
          speed: 0,
          showSpeeds: false,
          showRates: false,
          showScreen: false,
          screenSize: 0,
          screenScale: 0,
          progressClientLeft: 0,
          progressClientWidth: 0,
          moveType: "",
          play: false,
          locked: false,
          showTipJiaSu: true,
          floatType: -1,
          volumeNum: 100,
          lightNum: 100,
          showNumJiaSu: false,
          showNum: 0,
          rates: RateList
        };
      }
      componentDidMount() {
        const {events} = this.props;
        this.resize();
        document.addEventListener("touchmove", throttle_1(this.globalTouchMove.bind(this), 1e3 / 60));
        document.addEventListener("touchend", this.globalTouchEnd.bind(this));
        document.addEventListener("touchcancel", this.globalTouchEnd.bind(this));
        window.addEventListener("resize", () => this.resize());
        events.on(Events2.PlayerTimeUpdate, (e) => {
          this.setState({
            current: secondToDate(e.current),
            duration: secondToDate(e.duration),
            currentRate: (e.current * 100 / e.duration).toFixed(2)
          });
        });
        events.on(Events2.PlayerReady, () => {
          this.setState({
            loading: false
          });
        });
        events.on(Events2.PlayerPlay, (bol) => {
          this.setState({
            play: bol
          });
        });
        events.on(Events2.PlayerTitle, (title) => {
          this.setState({
            title
          });
        });
        events.on(Events2.PlayerRates, (rates) => {
          this.setState({
            rates
          });
        });
        events.on(Events2.PlayerCount, ({last, used}) => {
          console.log(last, used);
          this.setState({
            showNumJiaSu: true,
            showNum: last
          });
          setTimeout(() => {
            this.setState({
              showNumJiaSu: false
            });
          }, 5e3);
        });
      }
      resize() {
        const ProgressBar2 = document.getElementById(ProgressBarId);
        const progressClient = ProgressBar2.getBoundingClientRect();
        console.log(progressClient);
        this.setState({
          progressClientWidth: Math.floor(progressClient.width),
          progressClientLeft: Math.ceil(progressClient.left)
        });
        windowInnerWidth = window.innerWidth;
        windowInnerHeight = window.innerHeight;
      }
      componentWillUnmount() {
        document.removeEventListener("touchmove", (e) => this.globalTouchMove(e));
        document.removeEventListener("touchend", this.globalTouchEnd);
        window.removeEventListener("resize", () => this.resize());
      }
      appClick(e) {
        this.setState({
          showRates: false,
          showSpeeds: false,
          showScreen: false
        });
      }
      switchSpeed(speed) {
        const {events} = this.props;
        console.log(events);
        this.setState({
          speed
        });
        events.emit(Events2.PlayerSpeed, speed);
      }
      switchRate(rate) {
        const {events} = this.props;
        console.log(events);
        this.setState({
          rate
        });
        events.emit(Events2.PlayerRate, rate);
      }
      switchSize(size) {
        const {events} = this.props;
        this.setState({
          screenSize: size
        });
        events.emit(Events2.PlayerSize, ScreenSizeBtns[size]);
      }
      switchScale(scale) {
        const {events} = this.props;
        this.setState({
          screenScale: scale
        });
        events.emit(Events2.PlayerScale, scale);
      }
      seek(e) {
        const {progressClientWidth} = this.state;
        const seekTime = (e.offsetX / progressClientWidth).toFixed(2);
        console.log(e.offsetX, progressClientWidth, seekTime);
        this.setState({
          widthCurrent: Number(seekTime) * 100
        });
      }
      seekDot(e) {
        if (this.state.locked)
          return;
        if (e.type === "touchstart") {
          this.setState({
            moveType: "seek"
          });
        } else {
          this.setState({
            moveType: ""
          });
          this.props.events.emit(Events2.PlayerSeek, this.state.currentRate);
        }
      }
      globalTouchMove(e) {
        const {moveType, lightNum, volumeNum, locked} = this.state;
        if (locked)
          return;
        const data = e.changedTouches[0];
        const clientX = data.clientX;
        if (moveType === "seek") {
          this.setState({
            widthCurrent: ((clientX - this.state.progressClientLeft) * 100 / this.state.progressClientWidth).toFixed(2)
          });
        } else {
          if (!touchData.start) {
            const type = data.clientX < windowInnerWidth / 2 ? 0 : 1;
            touchData = {
              type,
              start: true,
              x: data.clientX,
              y: data.clientY,
              num: type === 0 ? lightNum : volumeNum
            };
            this.setState({
              floatType: type
            });
          } else {
            let deltY = (windowInnerHeight - data.clientY - windowInnerHeight * 0.2) / (windowInnerHeight * 0.6);
            deltY = deltY > 0 ? deltY : 0;
            let newVal = (Math.min(deltY, 1) * 100).toFixed(2);
            if (touchData.type === 0) {
              this.setState({
                lightNum: newVal
              });
              this.props.events.emit(Events2.PlayerLight, newVal);
            } else {
              this.setState({
                volumeNum: newVal
              });
              this.props.events.emit(Events2.PlayerVolume, newVal);
            }
          }
        }
      }
      globalTouchEnd() {
        touchData.start = false;
        this.setState({
          floatType: -1
        });
      }
      onPlay() {
        const bol = this.state.play;
        this.setState({
          play: !bol
        });
        this.props.events.emit(Events2.PlayerPlay, !bol);
      }
      onLock() {
        this.setState({
          locked: !this.state.locked
        });
      }
      goVip() {
        console.log("goVip");
        this.props.events.emit(Events2.PlayerGoVip);
      }
      exitPlayer() {
        console.log(11);
        this.props.events.emit(Events2.PlayerExit);
      }
      render(props, state) {
        const speeds = props.speeds || SpeedList;
        const rates = state.rates;
        return m$1`
      <${App} onClick=${(e) => this.appClick(e)}>
        <${GlobalStyle}><//>
        <${ScreenLoad} show=${state.loading}>
          <${ScreenLoadImg}><//>
          <${ScreenLoadTip}>视频正在加载…<//>
        <//>
        <${Banner}>
          <${Btn} className=${`iconfont xlp-arrow`} onClick=${(e) => {
      e.stopPropagation();
      this.exitPlayer();
    }}><//>
          <${Title}>${state.title}<//>
          <div className="menu-bar" onClick=${(e) => {
      e.stopPropagation();
      if (state.locked)
        return;
      this.setState({showScreen: true});
    }}>
            <${Btn} className=${`iconfont xlp-more`}><//>
          </div>
        <//>
        <${ScreenBox} show=${state.showScreen}>
          <p>画面尺寸:</p>
          <p style="margin:16px 0 40px 0;">
            ${ScreenSizeBtns.map((size, index) => m$1`<${ScreenSizeBtn} onClick=${(e) => {
      e.stopPropagation();
      this.switchSize(index);
    }} key=${size} on=${index === state.screenSize}>${size}%<//>`)}
          </p>
          <p>屏幕适配:</p>
          <p style="margin-top:16px;">
            ${ScreenScaleBtns.map((size, index) => m$1`<${ScreenSizeBtn} onClick=${(e) => {
      e.stopPropagation();
      this.switchScale(index);
    }} key=${size} on=${index === state.screenScale}>${size}<//>`)}
          </p>
        <//>
        <${Speeds} show=${state.showSpeeds}>
          ${speeds.map((speed, index) => m$1`<${Speed} key=${speed} on=${index === state.speed} onClick=${(e) => {
      e.stopPropagation();
      this.switchSpeed(index);
    }}>${speed}x<//>`)}
        <//>
        <${Speeds} show=${state.showRates}>
          <${RateTip}>当前视频原画质：4K<//>
          ${rates.map((rate, index) => m$1`<${Speed} key=${rate} on=${index === state.rate} onClick=${(e) => {
      e.stopPropagation();
      this.switchRate(index);
    }}>${rate}<//>`)}
        <//>
        <${Progress}>
          <${Timer}>${state.current}<//>
          <${ProgressBar} id=${ProgressBarId} onClick=${(e) => {
      e.stopPropagation();
      if (state.locked)
        return;
      this.seek(e);
    }}>
            <${ProgressBarCache} width=${state.currentCache}><//>
            <${ProgressBarCurrent} width=${state.currentRate}><//>
            <${ProgressBarDot} left=${state.currentRate} onTouchStart=${(e) => this.seekDot(e)} onTouchEnd=${(e) => this.seekDot(e)}><//>
          <//>
          <${Timer}>${state.duration}<//>
        <//>
        <${Btn} onClick=${(e) => {
      e.stopPropagation();
      this.onLock();
    }} className=${`iconfont xlp-${state.locked ? "locked" : "lock"}`}><//>
        <${Controls}>
          <${Btn} onClick=${(e) => {
      e.stopPropagation();
      if (state.locked)
        return;
      this.onPlay();
    }} className=${`iconfont xlp-${state.play ? "pause" : "play"}`}><//>
          <${TipJiaSu} show=${state.showTipJiaSu} onClick=${(e) => {
      e.stopPropagation();
      if (!state.showTipJiaSu)
        return;
      this.goVip();
    }}>
            <${Btn} className="iconfont xlp-jiasu"><//>
            云播加速
          <//>
          <${RateBtn} onClick=${(e) => {
      e.stopPropagation();
      if (state.locked)
        return;
      this.setState({showRates: true});
    }}>流畅<//>
          <${SpeedBtn} onClick=${(e) => {
      e.stopPropagation();
      if (state.locked)
        return;
      this.setState({showSpeeds: true});
    }}>倍速<//>
        <//>
        <${FloatBar} show=${state.floatType > -1}>
          <${Btn} onClick=${(e) => {
      e.stopPropagation();
    }} className=${`iconfont xlp-${state.floatType > 0 ? state.volumeNum <= 0 ? "muted" : "volume" : "light"}`}><//>
          <${FloatBarRange}>
            <${FloatBarRangeCurrent} width=${state.floatType > 0 ? state.volumeNum : state.lightNum}><//>
          <//>
        <//>
        <${TipPlayCountJiaSU} show=${state.showNumJiaSu}>
          <p>启动云播</p>
          <p>今天${state.showNum > 0 ? `\u5269\u4F59${state.showNum}\u6B21` : "\u6B21\u6570\u5DF2\u7528\u5B8C"}  <a href="javascript:;" onClick=${(e) => {
      e.stopPropagation();
      if (!state.showNumJiaSu)
        return;
      this.goVip();
    }}>开通会员</a></p>
        <//>
      <//>
    `;
      }
    }
    function ui2(id = "", events) {
      const target = id ? document.getElementById(id) : document.body;
      O(m$1`<${Player} events=${events} />`, target);
    }

    var WorkerClass = null;

    try {
        var WorkerThreads =
            typeof module !== 'undefined' && typeof module.require === 'function' && module.require('worker_threads') ||
            typeof __non_webpack_require__ === 'function' && __non_webpack_require__('worker_threads') ||
            typeof require === 'function' && require('worker_threads');
        WorkerClass = WorkerThreads.Worker;
    } catch(e) {} // eslint-disable-line

    function decodeBase64(base64, enableUnicode) {
        return Buffer.from(base64, 'base64').toString(enableUnicode ? 'utf16' : 'utf8');
    }

    function createBase64WorkerFactory(base64, sourcemapArg, enableUnicodeArg) {
        var sourcemap = sourcemapArg === undefined ? null : sourcemapArg;
        var enableUnicode = enableUnicodeArg === undefined ? false : enableUnicodeArg;
        var source = decodeBase64(base64, enableUnicode);
        var start = source.indexOf('\n', 10) + 1;
        var body = source.substring(start) + (sourcemap ? '\/\/# sourceMappingURL=' + sourcemap : '');
        return function WorkerFactory(options) {
            return new WorkerClass(body, Object.assign({}, options, { eval: true }));
        };
    }

    function decodeBase64$1(base64, enableUnicode) {
        var binaryString = atob(base64);
        if (enableUnicode) {
            var binaryView = new Uint8Array(binaryString.length);
            for (var i = 0, n = binaryString.length; i < n; ++i) {
                binaryView[i] = binaryString.charCodeAt(i);
            }
            return String.fromCharCode.apply(null, new Uint16Array(binaryView.buffer));
        }
        return binaryString;
    }

    function createURL(base64, sourcemapArg, enableUnicodeArg) {
        var sourcemap = sourcemapArg === undefined ? null : sourcemapArg;
        var enableUnicode = enableUnicodeArg === undefined ? false : enableUnicodeArg;
        var source = decodeBase64$1(base64, enableUnicode);
        var start = source.indexOf('\n', 10) + 1;
        var body = source.substring(start) + (sourcemap ? '\/\/# sourceMappingURL=' + sourcemap : '');
        var blob = new Blob([body], { type: 'application/javascript' });
        return URL.createObjectURL(blob);
    }

    function createBase64WorkerFactory$1(base64, sourcemapArg, enableUnicodeArg) {
        var url;
        return function WorkerFactory(options) {
            url = url || createURL(base64, sourcemapArg, enableUnicodeArg);
            return new Worker(url, options);
        };
    }

    var kIsNodeJS = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';

    function isNodeJS() {
        return kIsNodeJS;
    }

    function createBase64WorkerFactory$2(base64, sourcemapArg, enableUnicodeArg) {
        if (isNodeJS()) {
            return createBase64WorkerFactory(base64, sourcemapArg, enableUnicodeArg);
        }
        return createBase64WorkerFactory$1(base64, sourcemapArg, enableUnicodeArg);
    }

    var WorkerFactory = createBase64WorkerFactory$2('Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y29uc3Qgbj1zPT57c2VsZi5wb3N0TWVzc2FnZShzKX07Y2xhc3MgbHtoZWFkKHQpe2NvbnN0IGU9bmV3IFhNTEh0dHBSZXF1ZXN0O2Uub25yZWFkeXN0YXRlY2hhbmdlPSgpPT57aWYoZS5yZWFkeVN0YXRlPT09ZS5ET05FKXtjb25zdCBhPXBhcnNlSW50KGUuZ2V0UmVzcG9uc2VIZWFkZXIoIkNvbnRlbnQtTGVuZ3RoIikpO24oe3R5cGU6Im5vdGljZSIsbmFtZToiaGVhZCIsZGF0YTphfSl9fSxlLm9wZW4oIkhFQUQiLHQpLGUuc2VuZCgpfXBsYXlsaXN0KHQpe2NvbnN0IGU9bmV3IFhNTEh0dHBSZXF1ZXN0O2Uub25yZWFkeXN0YXRlY2hhbmdlPSgpPT57ZS5yZWFkeVN0YXRlPT09ZS5ET05FJiZlLnN0YXR1cz49MjAwJiZlLnN0YXR1czwzMDAmJm4oe3R5cGU6ImRhdGEiLG5hbWU6InBsYXlsaXN0IixkYXRhOmUucmVzcG9uc2V9KX0sZS5vcGVuKCJHRVQiLHQpLGUuc2VuZCgpfWZldGNoKHQpe2NvbnN0IGU9bmV3IFhNTEh0dHBSZXF1ZXN0O2xldCBhPXQubWF0Y2goL1w/KHJhbmdlOik/KFtcZF0rXC1bXGRdKikvKTthJiYodD10LnJlcGxhY2UoL1w/KHJhbmdlOik/KFtcZF0rXC1bXGRdKikvLCIiKSksY29uc29sZS5sb2coYSk7bGV0IHI9MCxjPURhdGUubm93KCk7ZS5vbnByb2dyZXNzPXA9Pntjb25zdCBpPU1hdGgucm91bmQocC5sb2FkZWQtcikvKERhdGUubm93KCktYyk7cj1wLmxvYWRlZCxjPURhdGUubm93KCksbih7dHlwZToibm90aWNlIixuYW1lOiJzcGVlZCIsZGF0YTpNYXRoLnJvdW5kKGkqMWUzLzEwMjQpfSl9LGUub25sb2FkPSgpPT57bih7dHlwZToiZGF0YSIsbmFtZToidHMiLGRhdGE6bmV3IFVpbnQ4QXJyYXkoZS5yZXNwb25zZSl9KX0sZS5vcGVuKCJHRVQiLHQpLGEmJmUuc2V0UmVxdWVzdEhlYWRlcigicmFuZ2UiLGBieXRlcz0ke2FbMl19YCksZS5yZXNwb25zZVR5cGU9ImFycmF5YnVmZmVyIixlLnNlbmQoKX19bGV0IG89bnVsbDtjb25zdCBkPWZ1bmN0aW9uKCl7cmV0dXJuIG98fChvPW5ldyBsKSxvfSgpO3NlbGYuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIscz0+e2NvbnNvbGUubG9nKHMpO2NvbnN0IHQ9cy5kYXRhLGU9dC50eXBlLGE9dC5tZXRob2Q7c3dpdGNoKGUpe2Nhc2UiaW52b2tlIjpkW2FdLmNhbGwoZCx0LnVybCx0Lm9wdGlvbnMsdC5uYW1lKTticmVha319KX0pKCk7Cgo=', 'data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cFdvcmtlci5qcyIsInNvdXJjZXMiOlsic3JjL0h0dHBXb3JrZXIudHMiXSwic291cmNlc0NvbnRlbnQiOlsiY29uc3Qgc2VuZE1lc3NhZ2UgPSAoZGF0YSkgPT4ge1xyXG4gIHNlbGYucG9zdE1lc3NhZ2UoZGF0YSk7XHJcbn07XHJcblxyXG5jbGFzcyBIVFRQIHtcclxuICBoZWFkKHVybCkge1xyXG4gICAgLy8gSEVBRCDmlrnms5XpnIDopoHmnI3liqHnq6/mlK/mjIFcclxuICAgIGNvbnN0IHJlcXVlc3QgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTtcclxuICAgIHJlcXVlc3Qub25yZWFkeXN0YXRlY2hhbmdlID0gKCkgPT4ge1xyXG4gICAgICBpZiAocmVxdWVzdC5yZWFkeVN0YXRlID09PSByZXF1ZXN0LkRPTkUpIHtcclxuICAgICAgICBjb25zdCBmaWxlU2l6ZSA9IHBhcnNlSW50KHJlcXVlc3QuZ2V0UmVzcG9uc2VIZWFkZXIoXCJDb250ZW50LUxlbmd0aFwiKSk7XHJcbiAgICAgICAgc2VuZE1lc3NhZ2Uoe1xyXG4gICAgICAgICAgdHlwZTogXCJub3RpY2VcIixcclxuICAgICAgICAgIG5hbWU6IFwiaGVhZFwiLFxyXG4gICAgICAgICAgZGF0YTogZmlsZVNpemUsXHJcbiAgICAgICAgfSk7XHJcbiAgICAgIH1cclxuICAgIH07XHJcbiAgICByZXF1ZXN0Lm9wZW4oXCJIRUFEXCIsIHVybCk7XHJcbiAgICByZXF1ZXN0LnNlbmQoKTtcclxuICB9XHJcbiAgcGxheWxpc3QodXJsKSB7XHJcbiAgICBjb25zdCByZXF1ZXN0ID0gbmV3IFhNTEh0dHBSZXF1ZXN0KCk7XHJcbiAgICByZXF1ZXN0Lm9ucmVhZHlzdGF0ZWNoYW5nZSA9ICgpID0+IHtcclxuICAgICAgaWYgKFxyXG4gICAgICAgIHJlcXVlc3QucmVhZHlTdGF0ZSA9PT0gcmVxdWVzdC5ET05FICYmXHJcbiAgICAgICAgcmVxdWVzdC5zdGF0dXMgPj0gMjAwICYmXHJcbiAgICAgICAgcmVxdWVzdC5zdGF0dXMgPCAzMDBcclxuICAgICAgKSB7XHJcbiAgICAgICAgc2VuZE1lc3NhZ2Uoe1xyXG4gICAgICAgICAgdHlwZTogXCJkYXRhXCIsXHJcbiAgICAgICAgICBuYW1lOiBcInBsYXlsaXN0XCIsXHJcbiAgICAgICAgICBkYXRhOiByZXF1ZXN0LnJlc3BvbnNlLFxyXG4gICAgICAgIH0pO1xyXG4gICAgICB9XHJcbiAgICB9O1xyXG4gICAgcmVxdWVzdC5vcGVuKFwiR0VUXCIsIHVybCk7XHJcbiAgICByZXF1ZXN0LnNlbmQoKTtcclxuICB9XHJcbiAgZmV0Y2godXJsKSB7XHJcbiAgICAvLyDkvb/nlKggcmFuZ2Ug5p2l5Y+R6YCB572R57uc6KeG6aKR6LWE5rqQ6K+35rGCXHJcbiAgICBjb25zdCByZXF1ZXN0ID0gbmV3IFhNTEh0dHBSZXF1ZXN0KCk7XHJcbiAgICBsZXQgcnMgPSB1cmwubWF0Y2goL1xcPyhyYW5nZTopPyhbXFxkXStcXC1bXFxkXSopLyk7XHJcbiAgICBpZiAocnMpIHtcclxuICAgICAgdXJsID0gdXJsLnJlcGxhY2UoL1xcPyhyYW5nZTopPyhbXFxkXStcXC1bXFxkXSopLywgXCJcIik7XHJcbiAgICB9XHJcbiAgICBjb25zb2xlLmxvZyhycylcclxuICAgIGxldCBsb2FkZWQgPSAwO1xyXG4gICAgbGV0IHN0YXJ0VGltZSA9IERhdGUubm93KCk7XHJcbiAgICByZXF1ZXN0Lm9ucHJvZ3Jlc3MgPSAoZXZ0KSA9PiB7XHJcbiAgICAgIGNvbnN0IHNwZWVkID0gTWF0aC5yb3VuZChldnQubG9hZGVkIC0gbG9hZGVkKSAvIChEYXRlLm5vdygpIC0gc3RhcnRUaW1lKTtcclxuICAgICAgbG9hZGVkID0gZXZ0LmxvYWRlZDtcclxuICAgICAgc3RhcnRUaW1lID0gRGF0ZS5ub3coKTtcclxuICAgICAgc2VuZE1lc3NhZ2Uoe1xyXG4gICAgICAgIHR5cGU6IFwibm90aWNlXCIsXHJcbiAgICAgICAgbmFtZTogXCJzcGVlZFwiLFxyXG4gICAgICAgIGRhdGE6IE1hdGgucm91bmQoKHNwZWVkICogMTAwMCkgLyAxMDI0KSwgLy8g5q+P56eS5aSa5bCRS2JcclxuICAgICAgfSk7XHJcbiAgICB9O1xyXG4gICAgcmVxdWVzdC5vbmxvYWQgPSAoKSA9PiB7XHJcbiAgICAgIHNlbmRNZXNzYWdlKHtcclxuICAgICAgICB0eXBlOiBcImRhdGFcIixcclxuICAgICAgICBuYW1lOiBcInRzXCIsXHJcbiAgICAgICAgZGF0YTogbmV3IFVpbnQ4QXJyYXkocmVxdWVzdC5yZXNwb25zZSksXHJcbiAgICAgIH0pO1xyXG4gICAgfTtcclxuICAgIHJlcXVlc3Qub3BlbihcIkdFVFwiLCB1cmwpO1xyXG4gICAgaWYgKHJzKSB7XHJcbiAgICAgIHJlcXVlc3Quc2V0UmVxdWVzdEhlYWRlcihcInJhbmdlXCIsIGBieXRlcz0ke3JzWzJdfWApO1xyXG4gICAgfVxyXG4gICAgcmVxdWVzdC5yZXNwb25zZVR5cGUgPSBcImFycmF5YnVmZmVyXCI7XHJcbiAgICByZXF1ZXN0LnNlbmQoKTtcclxuICB9XHJcbn1cclxuXHJcbmxldCBpbnN0YW5jZTogYW55ID0gbnVsbDtcclxuY29uc3QgaHR0cCA9IChmdW5jdGlvbiAoKSB7XHJcbiAgaWYgKCFpbnN0YW5jZSkge1xyXG4gICAgaW5zdGFuY2UgPSBuZXcgSFRUUCgpO1xyXG4gIH1cclxuICByZXR1cm4gaW5zdGFuY2U7XHJcbn0pKCk7XHJcblxyXG5zZWxmLmFkZEV2ZW50TGlzdGVuZXIoXCJtZXNzYWdlXCIsIChldmVudCkgPT4ge1xyXG4gIGNvbnNvbGUubG9nKGV2ZW50KTtcclxuICBjb25zdCBkYXRhID0gZXZlbnQuZGF0YTtcclxuICBjb25zdCB0eXBlID0gZGF0YS50eXBlO1xyXG4gIGNvbnN0IG1ldGhvZCA9IGRhdGEubWV0aG9kO1xyXG4gIHN3aXRjaCAodHlwZSkge1xyXG4gICAgY2FzZSBcImludm9rZVwiOlxyXG4gICAgICBodHRwW21ldGhvZF0uY2FsbChodHRwLCBkYXRhLnVybCwgZGF0YS5vcHRpb25zLCBkYXRhLm5hbWUpO1xyXG4gICAgICBicmVhaztcclxuICAgIGNhc2UgXCJub3RpY2VcIjpcclxuICAgICAgYnJlYWs7XHJcbiAgICBkZWZhdWx0OlxyXG4gICAgICBicmVhaztcclxuICB9XHJcbn0pO1xyXG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0VBQUEsTUFBTSxXQUFXLEdBQUcsQ0FBQyxJQUFJLEtBQUs7RUFDOUIsRUFBRSxJQUFJLENBQUMsV0FBVyxDQUFDLElBQUksQ0FBQyxDQUFDO0VBQ3pCLENBQUMsQ0FBQztFQUNGLE1BQU0sSUFBSSxDQUFDO0VBQ1gsRUFBRSxJQUFJLENBQUMsR0FBRyxFQUFFO0VBQ1osSUFBSSxNQUFNLE9BQU8sR0FBRyxJQUFJLGNBQWMsRUFBRSxDQUFDO0VBQ3pDLElBQUksT0FBTyxDQUFDLGtCQUFrQixHQUFHLE1BQU07RUFDdkMsTUFBTSxJQUFJLE9BQU8sQ0FBQyxVQUFVLEtBQUssT0FBTyxDQUFDLElBQUksRUFBRTtFQUMvQyxRQUFRLE1BQU0sUUFBUSxHQUFHLFFBQVEsQ0FBQyxPQUFPLENBQUMsaUJBQWlCLENBQUMsZ0JBQWdCLENBQUMsQ0FBQyxDQUFDO0VBQy9FLFFBQVEsV0FBVyxDQUFDO0VBQ3BCLFVBQVUsSUFBSSxFQUFFLFFBQVE7RUFDeEIsVUFBVSxJQUFJLEVBQUUsTUFBTTtFQUN0QixVQUFVLElBQUksRUFBRSxRQUFRO0VBQ3hCLFNBQVMsQ0FBQyxDQUFDO0VBQ1gsT0FBTztFQUNQLEtBQUssQ0FBQztFQUNOLElBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxNQUFNLEVBQUUsR0FBRyxDQUFDLENBQUM7RUFDOUIsSUFBSSxPQUFPLENBQUMsSUFBSSxFQUFFLENBQUM7RUFDbkIsR0FBRztFQUNILEVBQUUsUUFBUSxDQUFDLEdBQUcsRUFBRTtFQUNoQixJQUFJLE1BQU0sT0FBTyxHQUFHLElBQUksY0FBYyxFQUFFLENBQUM7RUFDekMsSUFBSSxPQUFPLENBQUMsa0JBQWtCLEdBQUcsTUFBTTtFQUN2QyxNQUFNLElBQUksT0FBTyxDQUFDLFVBQVUsS0FBSyxPQUFPLENBQUMsSUFBSSxJQUFJLE9BQU8sQ0FBQyxNQUFNLElBQUksR0FBRyxJQUFJLE9BQU8sQ0FBQyxNQUFNLEdBQUcsR0FBRyxFQUFFO0VBQ2hHLFFBQVEsV0FBVyxDQUFDO0VBQ3BCLFVBQVUsSUFBSSxFQUFFLE1BQU07RUFDdEIsVUFBVSxJQUFJLEVBQUUsVUFBVTtFQUMxQixVQUFVLElBQUksRUFBRSxPQUFPLENBQUMsUUFBUTtFQUNoQyxTQUFTLENBQUMsQ0FBQztFQUNYLE9BQU87RUFDUCxLQUFLLENBQUM7RUFDTixJQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLEdBQUcsQ0FBQyxDQUFDO0VBQzdCLElBQUksT0FBTyxDQUFDLElBQUksRUFBRSxDQUFDO0VBQ25CLEdBQUc7RUFDSCxFQUFFLEtBQUssQ0FBQyxHQUFHLEVBQUU7RUFDYixJQUFJLE1BQU0sT0FBTyxHQUFHLElBQUksY0FBYyxFQUFFLENBQUM7RUFDekMsSUFBSSxJQUFJLEVBQUUsR0FBRyxHQUFHLENBQUMsS0FBSyxDQUFDLDJCQUEyQixDQUFDLENBQUM7RUFDcEQsSUFBSSxJQUFJLEVBQUUsRUFBRTtFQUNaLE1BQU0sR0FBRyxHQUFHLEdBQUcsQ0FBQyxPQUFPLENBQUMsMkJBQTJCLEVBQUUsRUFBRSxDQUFDLENBQUM7RUFDekQsS0FBSztFQUNMLElBQUksT0FBTyxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsQ0FBQztFQUNwQixJQUFJLElBQUksTUFBTSxHQUFHLENBQUMsQ0FBQztFQUNuQixJQUFJLElBQUksU0FBUyxHQUFHLElBQUksQ0FBQyxHQUFHLEVBQUUsQ0FBQztFQUMvQixJQUFJLE9BQU8sQ0FBQyxVQUFVLEdBQUcsQ0FBQyxHQUFHLEtBQUs7RUFDbEMsTUFBTSxNQUFNLEtBQUssR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDLElBQUksSUFBSSxDQUFDLEdBQUcsRUFBRSxHQUFHLFNBQVMsQ0FBQyxDQUFDO0VBQy9FLE1BQU0sTUFBTSxHQUFHLEdBQUcsQ0FBQyxNQUFNLENBQUM7RUFDMUIsTUFBTSxTQUFTLEdBQUcsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFDO0VBQzdCLE1BQU0sV0FBVyxDQUFDO0VBQ2xCLFFBQVEsSUFBSSxFQUFFLFFBQVE7RUFDdEIsUUFBUSxJQUFJLEVBQUUsT0FBTztFQUNyQixRQUFRLElBQUksRUFBRSxJQUFJLENBQUMsS0FBSyxDQUFDLEtBQUssR0FBRyxHQUFHLEdBQUcsSUFBSSxDQUFDO0VBQzVDLE9BQU8sQ0FBQyxDQUFDO0VBQ1QsS0FBSyxDQUFDO0VBQ04sSUFBSSxPQUFPLENBQUMsTUFBTSxHQUFHLE1BQU07RUFDM0IsTUFBTSxXQUFXLENBQUM7RUFDbEIsUUFBUSxJQUFJLEVBQUUsTUFBTTtFQUNwQixRQUFRLElBQUksRUFBRSxJQUFJO0VBQ2xCLFFBQVEsSUFBSSxFQUFFLElBQUksVUFBVSxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUM7RUFDOUMsT0FBTyxDQUFDLENBQUM7RUFDVCxLQUFLLENBQUM7RUFDTixJQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLEdBQUcsQ0FBQyxDQUFDO0VBQzdCLElBQUksSUFBSSxFQUFFLEVBQUU7RUFDWixNQUFNLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxPQUFPLEVBQUUsQ0FBQyxNQUFNLEVBQUUsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0VBQzFELEtBQUs7RUFDTCxJQUFJLE9BQU8sQ0FBQyxZQUFZLEdBQUcsYUFBYSxDQUFDO0VBQ3pDLElBQUksT0FBTyxDQUFDLElBQUksRUFBRSxDQUFDO0VBQ25CLEdBQUc7RUFDSCxDQUFDO0VBQ0QsSUFBSSxRQUFRLEdBQUcsSUFBSSxDQUFDO0VBQ3BCLE1BQU0sSUFBSSxHQUFHLFdBQVc7RUFDeEIsRUFBRSxJQUFJLENBQUMsUUFBUSxFQUFFO0VBQ2pCLElBQUksUUFBUSxHQUFHLElBQUksSUFBSSxFQUFFLENBQUM7RUFDMUIsR0FBRztFQUNILEVBQUUsT0FBTyxRQUFRLENBQUM7RUFDbEIsQ0FBQyxFQUFFLENBQUM7RUFDSixJQUFJLENBQUMsZ0JBQWdCLENBQUMsU0FBUyxFQUFFLENBQUMsS0FBSyxLQUFLO0VBQzVDLEVBQUUsT0FBTyxDQUFDLEdBQUcsQ0FBQyxLQUFLLENBQUMsQ0FBQztFQUNyQixFQUFFLE1BQU0sSUFBSSxHQUFHLEtBQUssQ0FBQyxJQUFJLENBQUM7RUFDMUIsRUFBRSxNQUFNLElBQUksR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDO0VBQ3pCLEVBQUUsTUFBTSxNQUFNLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQztFQUM3QixFQUFFLFFBQVEsSUFBSTtFQUNkLElBQUksS0FBSyxRQUFRO0VBQ2pCLE1BQU0sSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsSUFBSSxDQUFDLEdBQUcsRUFBRSxJQUFJLENBQUMsT0FBTyxFQUFFLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztFQUNqRSxNQUFNLE1BQU07RUFLWixHQUFHO0VBQ0gsQ0FBQyxDQUFDOzs7Ozs7In0=', false);
    /* eslint-enable */

    class CommonProcessor {
      source = []
      onPlay
      constructor(options) {
          this.source = options.source;
          this.onPlay = options.onPlay;
      }
      extract(target, numFrames) {
          let data = this.provide(numFrames);
          // console.error('[Common] buffer size = %d, request size = %d, response size = %d,  ',this.source.length, numFrames, data.size)
          for(let i=0; i< data.size; i++) {
              target[i * 2] = data.left[i];
              target[i * 2 + 1] = data.right[i];
          }
          return data.size
      }
      provide(size) {
          let sourceSize = size;
          let leftSource = new Float32Array(sourceSize);
          let rightSource = new Float32Array(sourceSize);
          let sourcePosition = 0;
          let audioTime = 0;
          let copySize = 0;
          while(this.source.length > 0) {
              var tmpBuffer = this.source.shift();
              var loadedPosition = tmpBuffer.loadedPosition || 0;
              audioTime = tmpBuffer.startTime + tmpBuffer.duration * loadedPosition / tmpBuffer.length;
              let copyLength = Math.min(tmpBuffer.length - loadedPosition, sourceSize - sourcePosition);
              let leftBuffer = tmpBuffer.getChannelData(0);
              let rightBuffer = tmpBuffer.numberOfChannels > 1 ? tmpBuffer.getChannelData(1): tmpBuffer.getChannelData(0);
              //fill channel data with buffer
              leftSource.set(leftBuffer.slice(loadedPosition, loadedPosition + copyLength), sourcePosition);
              rightSource.set(rightBuffer.slice(loadedPosition, loadedPosition + copyLength), sourcePosition);
              copySize += copyLength;
              loadedPosition += copyLength;
              sourcePosition += copyLength;
              if(loadedPosition < tmpBuffer.length) {
                  tmpBuffer.loadedPosition = loadedPosition;
                  this.source.unshift(tmpBuffer);
                  break;
              }
          }
          if(this.onPlay) {
              this.onPlay(audioTime);
          }
          return {
              left: leftSource,
              right: rightSource,
              size: copySize
          }
      }
    }

    /*
     * SoundTouch JS v0.1.24 audio processing library
     * Copyright (c) Olli Parviainen
     * Copyright (c) Ryan Berdeen
     * Copyright (c) Jakub Fiala
     * Copyright (c) Steve 'Cutter' Blades
     *
     * This library is free software; you can redistribute it and/or
     * modify it under the terms of the GNU Lesser General Public
     * License as published by the Free Software Foundation; either
     * version 2.1 of the License, or (at your option) any later version.
     *
     * This library is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     * Lesser General Public License for more details.
     *
     * You should have received a copy of the GNU Lesser General Public
     * License along with this library; if not, write to the Free Software
     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     */

    class FifoSampleBuffer {
      constructor() {
        this._vector = new Float32Array();
        this._position = 0;
        this._frameCount = 0;
      }
      get vector() {
        return this._vector;
      }
      get position() {
        return this._position;
      }
      get startIndex() {
        return this._position * 2;
      }
      get frameCount() {
        return this._frameCount;
      }
      get endIndex() {
        return (this._position + this._frameCount) * 2;
      }
      clear() {
        this.receive(this._frameCount);
        this.rewind();
      }
      put(numFrames) {
        this._frameCount += numFrames;
      }
      putSamples(samples, position, numFrames = 0) {
        position = position || 0;
        const sourceOffset = position * 2;
        if (!(numFrames >= 0)) {
          numFrames = (samples.length - sourceOffset) / 2;
        }
        const numSamples = numFrames * 2;
        this.ensureCapacity(numFrames + this._frameCount);
        const destOffset = this.endIndex;
        this.vector.set(samples.subarray(sourceOffset, sourceOffset + numSamples), destOffset);
        this._frameCount += numFrames;
      }
      putBuffer(buffer, position, numFrames = 0) {
        position = position || 0;
        if (!(numFrames >= 0)) {
          numFrames = buffer.frameCount - position;
        }
        this.putSamples(buffer.vector, buffer.position + position, numFrames);
      }
      receive(numFrames) {
        if (!(numFrames >= 0) || numFrames > this._frameCount) {
          numFrames = this.frameCount;
        }
        this._frameCount -= numFrames;
        this._position += numFrames;
      }
      receiveSamples(output, numFrames = 0) {
        const numSamples = numFrames * 2;
        const sourceOffset = this.startIndex;
        output.set(this._vector.subarray(sourceOffset, sourceOffset + numSamples));
        this.receive(numFrames);
      }
      extract(output, position = 0, numFrames = 0) {
        const sourceOffset = this.startIndex + position * 2;
        const numSamples = numFrames * 2;
        output.set(this._vector.subarray(sourceOffset, sourceOffset + numSamples));
      }
      ensureCapacity(numFrames = 0) {
        const minLength = parseInt(numFrames * 2);
        if (this._vector.length < minLength) {
          const newVector = new Float32Array(minLength);
          newVector.set(this._vector.subarray(this.startIndex, this.endIndex));
          this._vector = newVector;
          this._position = 0;
        } else {
          this.rewind();
        }
      }
      ensureAdditionalCapacity(numFrames = 0) {
        this.ensureCapacity(this._frameCount + numFrames);
      }
      rewind() {
        if (this._position > 0) {
          this._vector.set(this._vector.subarray(this.startIndex, this.endIndex));
          this._position = 0;
        }
      }
    }

    class AbstractFifoSamplePipe {
      constructor(createBuffers) {
        if (createBuffers) {
          this._inputBuffer = new FifoSampleBuffer();
          this._outputBuffer = new FifoSampleBuffer();
        } else {
          this._inputBuffer = this._outputBuffer = null;
        }
      }
      get inputBuffer() {
        return this._inputBuffer;
      }
      set inputBuffer(inputBuffer) {
        this._inputBuffer = inputBuffer;
      }
      get outputBuffer() {
        return this._outputBuffer;
      }
      set outputBuffer(outputBuffer) {
        this._outputBuffer = outputBuffer;
      }
      clear() {
        this._inputBuffer.clear();
        this._outputBuffer.clear();
      }
    }

    class RateTransposer extends AbstractFifoSamplePipe {
      constructor(createBuffers) {
        super(createBuffers);
        this.reset();
        this._rate = 1;
      }
      set rate(rate) {
        this._rate = rate;
      }
      reset() {
        this.slopeCount = 0;
        this.prevSampleL = 0;
        this.prevSampleR = 0;
      }
      clone() {
        const result = new RateTransposer();
        result.rate = this._rate;
        return result;
      }
      process() {
        const numFrames = this._inputBuffer.frameCount;
        this._outputBuffer.ensureAdditionalCapacity(numFrames / this._rate + 1);
        const numFramesOutput = this.transpose(numFrames);
        this._inputBuffer.receive();
        this._outputBuffer.put(numFramesOutput);
      }
      transpose(numFrames = 0) {
        if (numFrames === 0) {
          return 0;
        }
        const src = this._inputBuffer.vector;
        const srcOffset = this._inputBuffer.startIndex;
        const dest = this._outputBuffer.vector;
        const destOffset = this._outputBuffer.endIndex;
        let used = 0;
        let i = 0;
        while (this.slopeCount < 1.0) {
          dest[destOffset + 2 * i] = (1.0 - this.slopeCount) * this.prevSampleL + this.slopeCount * src[srcOffset];
          dest[destOffset + 2 * i + 1] = (1.0 - this.slopeCount) * this.prevSampleR + this.slopeCount * src[srcOffset + 1];
          i = i + 1;
          this.slopeCount += this._rate;
        }
        this.slopeCount -= 1.0;
        if (numFrames !== 1) {
          out: while (true) {
            while (this.slopeCount > 1.0) {
              this.slopeCount -= 1.0;
              used = used + 1;
              if (used >= numFrames - 1) {
                break out;
              }
            }
            const srcIndex = srcOffset + 2 * used;
            dest[destOffset + 2 * i] = (1.0 - this.slopeCount) * src[srcIndex] + this.slopeCount * src[srcIndex + 2];
            dest[destOffset + 2 * i + 1] = (1.0 - this.slopeCount) * src[srcIndex + 1] + this.slopeCount * src[srcIndex + 3];
            i = i + 1;
            this.slopeCount += this._rate;
          }
        }
        this.prevSampleL = src[srcOffset + 2 * numFrames - 2];
        this.prevSampleR = src[srcOffset + 2 * numFrames - 1];
        return i;
      }
    }

    class FilterSupport {
      constructor(pipe) {
        this._pipe = pipe;
      }
      get pipe() {
        return this._pipe;
      }
      get inputBuffer() {
        return this._pipe.inputBuffer;
      }
      get outputBuffer() {
        return this._pipe.outputBuffer;
      }
      fillInputBuffer()
      {
        throw new Error('fillInputBuffer() not overridden');
      }
      fillOutputBuffer(numFrames = 0) {
        while (this.outputBuffer.frameCount < numFrames) {
          const numInputFrames = 8192 * 2 - this.inputBuffer.frameCount;
          this.fillInputBuffer(numInputFrames);
          if (this.inputBuffer.frameCount < 8192 * 2) {
            break;
          }
          this._pipe.process();
        }
      }
      clear() {
        this._pipe.clear();
      }
    }

    const noop = function () {
      return;
    };

    class SimpleFilter extends FilterSupport {
      constructor(sourceSound, pipe, callback = noop) {
        super(pipe);
        this.callback = callback;
        this.sourceSound = sourceSound;
        this.historyBufferSize = 22050;
        this._sourcePosition = 0;
        this.outputBufferPosition = 0;
        this._position = 0;
      }
      get position() {
        return this._position;
      }
      set position(position) {
        if (position > this._position) {
          throw new RangeError('New position may not be greater than current position');
        }
        const newOutputBufferPosition = this.outputBufferPosition - (this._position - position);
        if (newOutputBufferPosition < 0) {
          throw new RangeError('New position falls outside of history buffer');
        }
        this.outputBufferPosition = newOutputBufferPosition;
        this._position = position;
      }
      get sourcePosition() {
        return this._sourcePosition;
      }
      set sourcePosition(sourcePosition) {
        this.clear();
        this._sourcePosition = sourcePosition;
      }
      onEnd() {
        this.callback();
      }
      fillInputBuffer(numFrames = 0) {
        const samples = new Float32Array(numFrames * 2);
        const numFramesExtracted = this.sourceSound.extract(samples, numFrames, this._sourcePosition);
        this._sourcePosition += numFramesExtracted;
        this.inputBuffer.putSamples(samples, 0, numFramesExtracted);
      }
      extract(target, numFrames = 0) {
        this.fillOutputBuffer(this.outputBufferPosition + numFrames);
        const numFramesExtracted = Math.min(numFrames, this.outputBuffer.frameCount - this.outputBufferPosition);
        this.outputBuffer.extract(target, this.outputBufferPosition, numFramesExtracted);
        const currentFrames = this.outputBufferPosition + numFramesExtracted;
        this.outputBufferPosition = Math.min(this.historyBufferSize, currentFrames);
        this.outputBuffer.receive(Math.max(currentFrames - this.historyBufferSize, 0));
        this._position += numFramesExtracted;
        return numFramesExtracted;
      }
      handleSampleData(event) {
        this.extract(event.data, 4096);
      }
      clear() {
        super.clear();
        this.outputBufferPosition = 0;
      }
    }

    const USE_AUTO_SEQUENCE_LEN = 0;
    const DEFAULT_SEQUENCE_MS = USE_AUTO_SEQUENCE_LEN;
    const USE_AUTO_SEEKWINDOW_LEN = 0;
    const DEFAULT_SEEKWINDOW_MS = USE_AUTO_SEEKWINDOW_LEN;
    const DEFAULT_OVERLAP_MS = 8;
    const _SCAN_OFFSETS = [[124, 186, 248, 310, 372, 434, 496, 558, 620, 682, 744, 806, 868, 930, 992, 1054, 1116, 1178, 1240, 1302, 1364, 1426, 1488, 0], [-100, -75, -50, -25, 25, 50, 75, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-20, -15, -10, -5, 5, 10, 15, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-4, -3, -2, -1, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
    const AUTOSEQ_TEMPO_LOW = 0.5;
    const AUTOSEQ_TEMPO_TOP = 2.0;
    const AUTOSEQ_AT_MIN = 125.0;
    const AUTOSEQ_AT_MAX = 50.0;
    const AUTOSEQ_K = (AUTOSEQ_AT_MAX - AUTOSEQ_AT_MIN) / (AUTOSEQ_TEMPO_TOP - AUTOSEQ_TEMPO_LOW);
    const AUTOSEQ_C = AUTOSEQ_AT_MIN - AUTOSEQ_K * AUTOSEQ_TEMPO_LOW;
    const AUTOSEEK_AT_MIN = 25.0;
    const AUTOSEEK_AT_MAX = 15.0;
    const AUTOSEEK_K = (AUTOSEEK_AT_MAX - AUTOSEEK_AT_MIN) / (AUTOSEQ_TEMPO_TOP - AUTOSEQ_TEMPO_LOW);
    const AUTOSEEK_C = AUTOSEEK_AT_MIN - AUTOSEEK_K * AUTOSEQ_TEMPO_LOW;
    class Stretch extends AbstractFifoSamplePipe {
      constructor(createBuffers) {
        super(createBuffers);
        this._quickSeek = true;
        this.midBufferDirty = false;
        this.midBuffer = null;
        this.overlapLength = 0;
        this.autoSeqSetting = true;
        this.autoSeekSetting = true;
        this._tempo = 1;
        this.setParameters(44100, DEFAULT_SEQUENCE_MS, DEFAULT_SEEKWINDOW_MS, DEFAULT_OVERLAP_MS);
      }
      clear() {
        super.clear();
        this.clearMidBuffer();
      }
      clearMidBuffer() {
        if (this.midBufferDirty) {
          this.midBufferDirty = false;
          this.midBuffer = null;
        }
      }
      setParameters(sampleRate, sequenceMs, seekWindowMs, overlapMs) {
        if (sampleRate > 0) {
          this.sampleRate = sampleRate;
        }
        if (overlapMs > 0) {
          this.overlapMs = overlapMs;
        }
        if (sequenceMs > 0) {
          this.sequenceMs = sequenceMs;
          this.autoSeqSetting = false;
        } else {
          this.autoSeqSetting = true;
        }
        if (seekWindowMs > 0) {
          this.seekWindowMs = seekWindowMs;
          this.autoSeekSetting = false;
        } else {
          this.autoSeekSetting = true;
        }
        this.calculateSequenceParameters();
        this.calculateOverlapLength(this.overlapMs);
        this.tempo = this._tempo;
      }
      set tempo(newTempo) {
        let intskip;
        this._tempo = newTempo;
        this.calculateSequenceParameters();
        this.nominalSkip = this._tempo * (this.seekWindowLength - this.overlapLength);
        this.skipFract = 0;
        intskip = Math.floor(this.nominalSkip + 0.5);
        this.sampleReq = Math.max(intskip + this.overlapLength, this.seekWindowLength) + this.seekLength;
      }
      get tempo() {
        return this._tempo;
      }
      get inputChunkSize() {
        return this.sampleReq;
      }
      get outputChunkSize() {
        return this.overlapLength + Math.max(0, this.seekWindowLength - 2 * this.overlapLength);
      }
      calculateOverlapLength(overlapInMsec = 0) {
        let newOvl;
        newOvl = this.sampleRate * overlapInMsec / 1000;
        newOvl = newOvl < 16 ? 16 : newOvl;
        newOvl -= newOvl % 8;
        this.overlapLength = newOvl;
        this.refMidBuffer = new Float32Array(this.overlapLength * 2);
        this.midBuffer = new Float32Array(this.overlapLength * 2);
      }
      checkLimits(x, mi, ma) {
        return x < mi ? mi : x > ma ? ma : x;
      }
      calculateSequenceParameters() {
        let seq;
        let seek;
        if (this.autoSeqSetting) {
          seq = AUTOSEQ_C + AUTOSEQ_K * this._tempo;
          seq = this.checkLimits(seq, AUTOSEQ_AT_MAX, AUTOSEQ_AT_MIN);
          this.sequenceMs = Math.floor(seq + 0.5);
        }
        if (this.autoSeekSetting) {
          seek = AUTOSEEK_C + AUTOSEEK_K * this._tempo;
          seek = this.checkLimits(seek, AUTOSEEK_AT_MAX, AUTOSEEK_AT_MIN);
          this.seekWindowMs = Math.floor(seek + 0.5);
        }
        this.seekWindowLength = Math.floor(this.sampleRate * this.sequenceMs / 1000);
        this.seekLength = Math.floor(this.sampleRate * this.seekWindowMs / 1000);
      }
      set quickSeek(enable) {
        this._quickSeek = enable;
      }
      clone() {
        const result = new Stretch();
        result.tempo = this._tempo;
        result.setParameters(this.sampleRate, this.sequenceMs, this.seekWindowMs, this.overlapMs);
        return result;
      }
      seekBestOverlapPosition() {
        return this._quickSeek ? this.seekBestOverlapPositionStereoQuick() : this.seekBestOverlapPositionStereo();
      }
      seekBestOverlapPositionStereo() {
        let bestOffset;
        let bestCorrelation;
        let correlation;
        let i = 0;
        this.preCalculateCorrelationReferenceStereo();
        bestOffset = 0;
        bestCorrelation = Number.MIN_VALUE;
        for (; i < this.seekLength; i = i + 1) {
          correlation = this.calculateCrossCorrelationStereo(2 * i, this.refMidBuffer);
          if (correlation > bestCorrelation) {
            bestCorrelation = correlation;
            bestOffset = i;
          }
        }
        return bestOffset;
      }
      seekBestOverlapPositionStereoQuick() {
        let bestOffset;
        let bestCorrelation;
        let correlation;
        let scanCount = 0;
        let correlationOffset;
        let tempOffset;
        this.preCalculateCorrelationReferenceStereo();
        bestCorrelation = Number.MIN_VALUE;
        bestOffset = 0;
        correlationOffset = 0;
        tempOffset = 0;
        for (; scanCount < 4; scanCount = scanCount + 1) {
          let j = 0;
          while (_SCAN_OFFSETS[scanCount][j]) {
            tempOffset = correlationOffset + _SCAN_OFFSETS[scanCount][j];
            if (tempOffset >= this.seekLength) {
              break;
            }
            correlation = this.calculateCrossCorrelationStereo(2 * tempOffset, this.refMidBuffer);
            if (correlation > bestCorrelation) {
              bestCorrelation = correlation;
              bestOffset = tempOffset;
            }
            j = j + 1;
          }
          correlationOffset = bestOffset;
        }
        return bestOffset;
      }
      preCalculateCorrelationReferenceStereo() {
        let i = 0;
        let context;
        let temp;
        for (; i < this.overlapLength; i = i + 1) {
          temp = i * (this.overlapLength - i);
          context = i * 2;
          this.refMidBuffer[context] = this.midBuffer[context] * temp;
          this.refMidBuffer[context + 1] = this.midBuffer[context + 1] * temp;
        }
      }
      calculateCrossCorrelationStereo(mixingPosition, compare) {
        const mixing = this._inputBuffer.vector;
        mixingPosition += this._inputBuffer.startIndex;
        let correlation = 0;
        let i = 2;
        const calcLength = 2 * this.overlapLength;
        let mixingOffset;
        for (; i < calcLength; i = i + 2) {
          mixingOffset = i + mixingPosition;
          correlation += mixing[mixingOffset] * compare[i] + mixing[mixingOffset + 1] * compare[i + 1];
        }
        return correlation;
      }
      overlap(overlapPosition) {
        this.overlapStereo(2 * overlapPosition);
      }
      overlapStereo(inputPosition) {
        const input = this._inputBuffer.vector;
        inputPosition += this._inputBuffer.startIndex;
        const output = this._outputBuffer.vector;
        const outputPosition = this._outputBuffer.endIndex;
        let i = 0;
        let context;
        let tempFrame;
        const frameScale = 1 / this.overlapLength;
        let fi;
        let inputOffset;
        let outputOffset;
        for (; i < this.overlapLength; i = i + 1) {
          tempFrame = (this.overlapLength - i) * frameScale;
          fi = i * frameScale;
          context = 2 * i;
          inputOffset = context + inputPosition;
          outputOffset = context + outputPosition;
          output[outputOffset + 0] = input[inputOffset + 0] * fi + this.midBuffer[context + 0] * tempFrame;
          output[outputOffset + 1] = input[inputOffset + 1] * fi + this.midBuffer[context + 1] * tempFrame;
        }
      }
      process() {
        let offset;
        let temp;
        let overlapSkip;
        if (this.midBuffer === null) {
          if (this._inputBuffer.frameCount < this.overlapLength) {
            return;
          }
          this.midBuffer = new Float32Array(this.overlapLength * 2);
          this._inputBuffer.receiveSamples(this.midBuffer, this.overlapLength);
        }
        while (this._inputBuffer.frameCount >= this.sampleReq) {
          offset = this.seekBestOverlapPosition();
          this._outputBuffer.ensureAdditionalCapacity(this.overlapLength);
          this.overlap(Math.floor(offset));
          this._outputBuffer.put(this.overlapLength);
          temp = this.seekWindowLength - 2 * this.overlapLength;
          if (temp > 0) {
            this._outputBuffer.putBuffer(this._inputBuffer, offset + this.overlapLength, temp);
          }
          const start = this._inputBuffer.startIndex + 2 * (offset + this.seekWindowLength - this.overlapLength);
          this.midBuffer.set(this._inputBuffer.vector.subarray(start, start + 2 * this.overlapLength));
          this.skipFract += this.nominalSkip;
          overlapSkip = Math.floor(this.skipFract);
          this.skipFract -= overlapSkip;
          this._inputBuffer.receive(overlapSkip);
        }
      }
    }

    const testFloatEqual = function (a, b) {
      return (a > b ? a - b : b - a) > 1e-10;
    };

    class SoundTouch {
      constructor() {
        this.transposer = new RateTransposer(false);
        this.stretch = new Stretch(false);
        this._inputBuffer = new FifoSampleBuffer();
        this._intermediateBuffer = new FifoSampleBuffer();
        this._outputBuffer = new FifoSampleBuffer();
        this._rate = 0;
        this._tempo = 0;
        this.virtualPitch = 1.0;
        this.virtualRate = 1.0;
        this.virtualTempo = 1.0;
        this.calculateEffectiveRateAndTempo();
      }
      clear() {
        this.transposer.clear();
        this.stretch.clear();
      }
      clone() {
        const result = new SoundTouch();
        result.rate = this.rate;
        result.tempo = this.tempo;
        return result;
      }
      get rate() {
        return this._rate;
      }
      set rate(rate) {
        this.virtualRate = rate;
        this.calculateEffectiveRateAndTempo();
      }
      set rateChange(rateChange) {
        this._rate = 1.0 + 0.01 * rateChange;
      }
      get tempo() {
        return this._tempo;
      }
      set tempo(tempo) {
        this.virtualTempo = tempo;
        this.calculateEffectiveRateAndTempo();
      }
      set tempoChange(tempoChange) {
        this.tempo = 1.0 + 0.01 * tempoChange;
      }
      set pitch(pitch) {
        this.virtualPitch = pitch;
        this.calculateEffectiveRateAndTempo();
      }
      set pitchOctaves(pitchOctaves) {
        this.pitch = Math.exp(0.69314718056 * pitchOctaves);
        this.calculateEffectiveRateAndTempo();
      }
      set pitchSemitones(pitchSemitones) {
        this.pitchOctaves = pitchSemitones / 12.0;
      }
      get inputBuffer() {
        return this._inputBuffer;
      }
      get outputBuffer() {
        return this._outputBuffer;
      }
      calculateEffectiveRateAndTempo() {
        const previousTempo = this._tempo;
        const previousRate = this._rate;
        this._tempo = this.virtualTempo / this.virtualPitch;
        this._rate = this.virtualRate * this.virtualPitch;
        if (testFloatEqual(this._tempo, previousTempo)) {
          this.stretch.tempo = this._tempo;
        }
        if (testFloatEqual(this._rate, previousRate)) {
          this.transposer.rate = this._rate;
        }
        if (this._rate > 1.0) {
          if (this._outputBuffer != this.transposer.outputBuffer) {
            this.stretch.inputBuffer = this._inputBuffer;
            this.stretch.outputBuffer = this._intermediateBuffer;
            this.transposer.inputBuffer = this._intermediateBuffer;
            this.transposer.outputBuffer = this._outputBuffer;
          }
        } else {
          if (this._outputBuffer != this.stretch.outputBuffer) {
            this.transposer.inputBuffer = this._inputBuffer;
            this.transposer.outputBuffer = this._intermediateBuffer;
            this.stretch.inputBuffer = this._intermediateBuffer;
            this.stretch.outputBuffer = this._outputBuffer;
          }
        }
      }
      process() {
        if (this._rate > 1.0) {
          this.stretch.process();
          this.transposer.process();
        } else {
          this.transposer.process();
          this.stretch.process();
        }
      }
    }

    class RateProcessor {
        soundTouch
        filter
        constructor(options) {
            this.init(options.source);
        }
        init(source) {
            this.soundTouch = new SoundTouch();
            this.soundTouch.tempo = 1;
            this.soundTouch.rate = 1;
            this.filter = new SimpleFilter(source, this.soundTouch, 2048);
        }
        set rate(value) {
            this.soundTouch.tempo = value;
        }
        provide(size) {
            let target = new Float32Array(size * 2);
            let framesExtracted = this.filter.extract(target, size);
            // console.error('[Rate] request size = %d, response size = %d', size, framesExtracted)
            let left = new Float32Array(framesExtracted);
            let right = new Float32Array(framesExtracted);
            for(let i=0; i<framesExtracted; i++) {
                left[i] = target[i * 2];
                right[i] = target[i * 2 + 1];
            }
            return {
                size: framesExtracted,
                left,
                right,
            }
        }
    }

    class AudioProvider {
        currentRate = 1
        source = []
        commonProcessor
        rateProcessor
        audioTime = 0
        constructor(options) {
            this.source = options.source;
            this.init();
        }
        init() {
            this.commonProcessor = new CommonProcessor({
                source: this.source,
                onPlay: (time)=> {
                    this.audioTime = time;
                }
            });
            this.rateProcessor = new RateProcessor({
                source: this.commonProcessor
            });
        }
        set rate(value) {
            this.currentRate = value;
            this.rateProcessor.rate = value;
        }
        provide(size) {
            let provider = this.currentRate === 1 ? this.commonProcessor: this.rateProcessor;
            let audioData = provider.provide(size);
            audioData.audioTime = this.audioTime;
            return audioData
        }
    }

    const EVENTS = {
      CANPLAY: "canplaythrough",
      SEEKED: "seeked",
      WAIT: "waiting"
    };
    class AudioContextPlayer {
      constructor(options) {
        this.audioContext = null;
        this.scriptNode = null;
        this.gainNode = null;
        this.delay = 0;
        this.audioBuffer = new ArrayBuffer(0);
        this.decodedBuffer = [];
        this.isFirstPlay = true;
        this.defaultVolume = 1;
        this.currentRate = 1;
        this.eventListeners = {};
        this.canPlay = false;
        this.seekTimeDelta = 0;
        this.audioTime = 0;
        this.isWaiting = false;
        this.flushTime = 1e3;
        this.count = 0;
        this.curDuration = 0;
        this.events = options.events;
        options = Object.assign({}, options);
        this.flushTime = options.flushTime || 1e3;
        this.onReady = options.onReady;
        this.init();
      }
      init() {
        this.audioProvider = new AudioProvider({
          source: this.decodedBuffer
        });
        if (typeof this.onReady == "function") {
          setTimeout(this.onReady, 0);
        }
        this.events.on(Events2.DemuxedAAC, () => {
          console.log("\u66F4\u65B0\u4E86");
        });
      }
      feed({audio}) {
        this.audioBuffer = this.appendByteArray(this.audioBuffer, audio);
        if (!this.canPlay) {
          this.canPlay = true;
          this.triggerEvent(EVENTS.CANPLAY);
        }
      }
      appendByteArray(buffer1, buffer2) {
        let tmp = new Uint8Array((buffer1.byteLength | 0) + (buffer2.byteLength | 0));
        tmp.set(new Uint8Array(buffer1), 0);
        tmp.set(new Uint8Array(buffer2), buffer1.byteLength | 0);
        var res = tmp.buffer;
        return res;
      }
      decodeAudioData(callback) {
        if (this.audioBuffer && this.audioBuffer.byteLength > 0) {
          this.audioContext.decodeAudioData(this.audioBuffer, (buffer) => {
            buffer.startTime = this.delay;
            this.delay += buffer.duration;
            console.log("\u8BE5\u6BB5\u97F3\u9891\u65F6\u957F", buffer.duration);
            this.curDuration += 1;
            this.decodedBuffer.push(buffer);
            if (callback)
              callback.call();
          });
          this.audioBuffer = new ArrayBuffer(0);
        }
      }
      play() {
        return new Promise((resolve, reject) => {
          if (this.isFirstPlay) {
            this.isFirstPlay = false;
            console.info("startPlay");
            this.audioContext = new (window.AudioContext || window.webkitAudioContext)();
            this.gainNode = this.audioContext.createGain();
            this.gainNode.gain.value = this.defaultVolume;
            this.scriptNode = this.audioContext.createScriptProcessor(2048, 2, 2);
            this.scriptNode.onaudioprocess = (audioProcessingEvent) => {
              let outputBuffer = audioProcessingEvent.outputBuffer;
              let sourceSize = outputBuffer.length;
              let audioData = this.audioProvider.provide(sourceSize);
              if (audioData.size === 0) {
                if (!this.isWaiting) {
                  this.isWaiting = true;
                  this.triggerEvent(EVENTS.WAIT);
                }
                return;
              } else {
                if (this.isWaiting) {
                  this.isWaiting = false;
                  this.triggerEvent(EVENTS.CANPLAY);
                }
              }
              let leftDst = outputBuffer.getChannelData(0);
              let rightDst = outputBuffer.getChannelData(1);
              if (audioData.audioTime != 0) {
                this.audioTime = audioData.audioTime;
              }
              leftDst.set(audioData.left);
              rightDst.set(audioData.right);
              if (audioData.size < sourceSize) {
                let emptyArray = new Float32Array(sourceSize - audioData.size);
                leftDst.set(emptyArray, audioData.size);
                rightDst.set(emptyArray, audioData.size);
              }
            };
            this.scriptNode.connect(this.gainNode);
            this.gainNode.connect(this.audioContext.destination);
            this.interval = setInterval(this.decodeAudioData.bind(this), this.flushTime);
          } else {
            if (this.audioContext.state === "suspended") {
              this.audioContext.resume().then(() => {
                console.info("play", "Audio is resumed");
                resolve();
              });
            } else {
              console.info("Audio resumed from waiting");
              resolve();
            }
          }
        });
      }
      get currentTime() {
        return this.audioTime;
      }
      set currentTime(time) {
        this.audioTime = time;
        while (this.decodedBuffer.length > 0) {
          let tmpBuffer = this.decodedBuffer.shift();
          if (tmpBuffer.startTime <= time && tmpBuffer.startTime + tmpBuffer.duration > time) {
            tmpBuffer.loadedPosition = Math.floor(tmpBuffer.length * (time - tmpBuffer.startTime) / tmpBuffer.duration);
            this.decodedBuffer.unshift(tmpBuffer);
            break;
          }
        }
        setTimeout(() => {
          this.triggerEvent(EVENTS.SEEKED);
        }, 0);
      }
      pause() {
        if (this.audioContext) {
          this.audioContext.suspend().then(() => {
            console.info("pause", "Audio is paused");
          });
        }
      }
      addEventListener(type, handler) {
        this.eventListeners[type] = handler;
      }
      triggerEvent(type) {
        var handler = this.eventListeners[type];
        if (handler) {
          handler.call();
        }
      }
      buffer() {
        let start = 0;
        if (this.decodedBuffer.length > 0) {
          let tmp = this.decodedBuffer[0];
          start = tmp.startTime;
        }
        return {
          start: start * 1e3,
          end: Math.floor(this.delay * 1e3)
        };
      }
      get volume() {
        return this.gainNode ? this.gainNode.gain.value : 0;
      }
      set volume(value) {
        if (this.gainNode) {
          this.gainNode.gain.value = value;
        } else {
          this.defaultVolume = value;
        }
      }
      destroy() {
        this.delay = 0;
        if (this.audioContext) {
          clearInterval(this.interval);
          this.scriptNode.disconnect();
          this.scriptNode = null;
          this.audioContext.close();
          this.audioContext = null;
        }
        this.gainNode = null;
        this.audioBuffer = new ArrayBuffer(0);
        this.canPlay = false;
        this.isFirstPlay = true;
        this.decodedBuffer.length = 0;
        this.seekTimeDelta = 0;
        this.audioTime = 0;
      }
      set playbackRate(value) {
        if (value !== this.currentRate) {
          this.currentRate = value;
          this.audioProvider.rate = value;
        }
      }
      testAutoplay(resolve, reject) {
        let audio = document.createElement("audio");
        let promise = audio.play();
        audio = null;
        let isRejected = false;
        if (promise !== void 0) {
          promise.catch(() => {
            isRejected = true;
          });
          setTimeout(() => {
            promise = null;
            if (isRejected) {
              reject("Autoplay is prevented");
              this.events.emit(Events2.PlayerStop, true);
            } else {
              resolve();
            }
          }, 100);
        } else {
          reject("Promise is undefined");
        }
      }
    }

    class AudioPlayer {
      constructor(options) {
        this.need = true;
        this.first = false;
        this.offset = 0;
        this.currentPTS = 0;
        this.ready = false;
        this.end = false;
        this.lastData = null;
        this.nodeParent = null;
        this.useJMuxer = false;
        this.onSeekedHandler = null;
        this.events = options.events;
        this.player = options.audioNode;
        this.createAudioMuxer();
        this.bindEvent();
      }
      bindEvent() {
        this.bindNodeEvent();
        this.events.on(Events2.PlayerMaxPTS, (maxAudioPts) => {
          if (this.currentPTS === maxAudioPts) {
            this.end = true;
          }
        });
      }
      bindNodeEvent() {
        this.addEventListener("seeked", () => {
          if (this.onSeekedHandler) {
            this.onSeekedHandler();
          }
          console.info("AudioPlayer.seeked");
        });
        this.addEventListener("canplaythrough", () => {
          console.info("canplaythrough");
          if (!this.ready) {
            this.ready = true;
            if (this.status === "wait") {
              this.play();
            }
            this.status = "ready";
            console.info("constructor", "canplaythrough", "ready");
            this.events.emit(Events2.AudioPlayerDataReady);
          }
        });
        this.addEventListener("waiting", () => {
          this.ready = false;
          if (!this.end) {
            if (!this.player)
              return;
            console.warn("audioPlayer waiting", this.player.currentTime, this.currentPTS);
            this.status = "wait";
            this.events.emit(Events2.PlayerWait, "audio");
          } else {
            if (!this.useJMuxer) {
              this.player.destroy();
            }
            this.status = "end";
            this.events.emit(Events2.AudioPlayerEnd, "audio");
            console.info("audioPlayer end");
          }
        });
      }
      reset() {
        this.lastData = null;
        this.first = false;
        this.offset = 0;
        this.currentPTS = 0;
        this.ready = false;
        this.end = false;
        this.clear();
        this.createAudioMuxer();
        this.bindNodeEvent();
        this.stime = null;
      }
      createAudioMuxer() {
        this.player = new AudioContextPlayer({
          events: this.events,
          onReady: this.onMSEReady.bind(this)
        });
      }
      onMSEReady() {
        console.info("onMSEReady", "AudioPlayerReady");
      }
      clear() {
        this.player.destroy();
        this.player = null;
      }
      play() {
        if (this.status !== "playing") {
          this.status = "playing";
          this.player.play().then(() => {
            console.info("AudioPlayerPlaySuccess");
            this.events.emit(Events2.AudioPlaySuccess);
          }).catch((error) => {
            console.error("play", "errorInfo:", error);
            this.events.emit(Events2.AudioPlayerDataReady, error);
          });
        }
      }
      set muted(value) {
        this.player.muted = !!value;
      }
      set playbackRate(value) {
        this.player.playbackRate = value;
      }
      pause() {
        if (this.status !== "pause") {
          this.status = "pause";
          this.player.pause();
        }
      }
      get volume() {
        return this.player.volume;
      }
      set volume(value) {
        this.player.volume = value;
        if (value === 0) {
          this.muted = true;
        } else {
          this.muted = false;
        }
      }
      get currentTime() {
        return Math.floor(this.player.currentTime * 1e3 + this.offset);
      }
      set currentTime(time) {
        this.player.currentTime = (time - this.offset) / 1e3;
      }
      get paused() {
        return this.player.paused;
      }
      send(data) {
        if (!data.PTS) {
          this.need = false;
          this.events.emit(Events2.AudioPlayerDataReady);
          return;
        }
        this.need = true;
        if (!this.player) {
          console.error("send", "player is:", this.player);
          return;
        }
        if (!this.stime) {
          this.stime = Date.now();
        }
        data = this.format(data);
        if (data.AudioPlayerEnd) {
          console.info("push", "AudioPlayerEnd");
          this.feed(this.lastData);
          this.lastData = null;
          return;
        }
        if (!this.first) {
          this.first = true;
          this.offset = data.start;
        }
        if (data.PTS > this.currentPTS) {
          if (!this.lastData) {
            this.lastData = data;
            return;
          } else {
            this.lastData.duration = data.PTS - this.lastData.PTS;
          }
          this.feed(this.lastData);
          data.duration = this.lastData.duration;
          this.lastData = data;
        }
      }
      feed(data) {
        this.player.feed({
          audio: data.data_byte,
          duration: data.duration
        });
        this.currentPTS = data.PTS;
      }
      format(data) {
        if (data && data.data_byte) {
          data.start = data.PTS;
        }
        return data;
      }
      addEventListener(type, handler) {
        this.player.addEventListener(type, handler);
      }
      isBuffered(time) {
        let bufferList = [this.buffer()];
        let index = bufferList.findIndex((item) => {
          return time >= item.start && time < item.end;
        });
        return index !== -1;
      }
      buffer() {
        if (this.useJMuxer) {
          let buffer = this.player.buffered;
          let length = buffer.length;
          let bufferInfo = {};
          while (length > 0) {
            bufferInfo.start = buffer.start(length - 1) * 1e3 + this.offset;
            bufferInfo.end = buffer.end(length - 1) * 1e3 + this.offset;
            length--;
          }
          return bufferInfo;
        } else {
          let buffer = this.player.buffer();
          return {
            start: buffer.start + this.offset,
            end: buffer.end + this.offset
          };
        }
      }
    }

    const ua = navigator.userAgent;
    const UA_IOS_REG = /\b(iPad|iPhone|iPod)\b.*? OS ([\d_]+)/;
    const isIOS13Pad = navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
    const isIOS = UA_IOS_REG.test(ua) || isIOS13Pad;
    const callbacks = window.G_callbacks = {
      _id: 0,
      _getId: function() {
        return this._id++;
      }
    };
    function sendMessage({jsBridge, method, target, params, isCallBack = false, callbackTimeout = 5e3, isJSON = true}) {
      if (!window[jsBridge]) {
        return Promise.reject("\u4E0D\u5728\u5BA2\u6237\u7AEF\u73AF\u5883\u5185");
      }
      const clientPromise = new Promise((resolve, reject) => {
        if (isCallBack) {
          window[jsBridge][method](target, params, (...args) => {
            resolve(args);
          });
        } else {
          let callbackName = null;
          const callbackKey = "_callback_" + callbacks._getId() + "_" + target;
          callbacks[callbackKey] = function(args) {
            callbacks[callbackKey] = null;
            window[callbackName] = null;
            const data = args && isJSON ? JSON.parse(args) : args;
            resolve(data);
          };
          callbackName = "window.G_callbacks." + callbackKey;
          window[jsBridge][method](target, JSON.stringify(params), callbackName);
        }
      });
      return Promise.race([
        clientPromise,
        promiseTimeOut(callbackTimeout, `${target}-\u5BA2\u6237\u7AEF\u901A\u4FE1\u8D85\u65F6`)
      ]);
    }
    function promiseTimeOut(time, reason = "") {
      return new Promise((resolve, reject) => {
        setTimeout(() => {
          reject(reason);
        }, time);
      });
    }

    var client2 = {
      isNative() {
        return !!window.XLJSWebViewBridge;
      },
      callFunction(target, params = {}) {
        return sendMessage({
          jsBridge: "XLJSWebViewBridge",
          method: "sendMessage",
          target,
          params
        });
      }
    };

    var __async = (__this, __arguments, generator) => {
      return new Promise((resolve, reject) => {
        var fulfilled = (value) => {
          try {
            step(generator.next(value));
          } catch (e) {
            reject(e);
          }
        };
        var rejected = (value) => {
          try {
            step(generator.throw(value));
          } catch (e) {
            reject(e);
          }
        };
        var step = (result) => {
          return result.done ? resolve(result.value) : Promise.resolve(result.value).then(fulfilled, rejected);
        };
        step((generator = generator.apply(__this, __arguments)).next());
      });
    };
    function callApp2(_0) {
      return __async(this, arguments, function* (type, params = {}) {
        try {
          const data = yield client2.callFunction(type, params);
          return data;
        } catch (e) {
          console.error(e);
          return null;
        }
      });
    }

    var __async$1 = (__this, __arguments, generator) => {
      return new Promise((resolve, reject) => {
        var fulfilled = (value) => {
          try {
            step(generator.next(value));
          } catch (e) {
            reject(e);
          }
        };
        var rejected = (value) => {
          try {
            step(generator.throw(value));
          } catch (e) {
            reject(e);
          }
        };
        var step = (result) => {
          return result.done ? resolve(result.value) : Promise.resolve(result.value).then(fulfilled, rejected);
        };
        step((generator = generator.apply(__this, __arguments)).next());
      });
    };
    var PlayType;
    (function(PlayType2) {
      PlayType2[PlayType2["video"] = 0] = "video";
      PlayType2[PlayType2["canvas"] = 1] = "canvas";
    })(PlayType || (PlayType = {}));
    class Player$1 {
      constructor({url, events, id = "", data, autoplay = false}) {
        this.videoSize = 0;
        this.videoChunks = [];
        this.chunkId = 0;
        this.isClientInit = false;
        this.title = "";
        this.medias = [];
        this.videoLight = 0;
        this.privilegeCfg = {
          used: 0,
          last: 0
        };
        this.id = id;
        this.url = url;
        this.events = events;
        this.dom = id ? document.getElementById(id) : document.body;
        this.playType = 0;
        if (data.title) {
          console.log(data);
          this.initData(data);
        }
        if (autoplay) {
          this.init();
        }
      }
      initData(data) {
        this.title = data.title;
        this.medias = data.medias;
        this.videoLight = data.light;
        this.events.emit(Events2.PlayerCount, {
          used: data.used,
          last: data.last
        });
        this.events.emit(Events2.PlayerTitle, this.title);
        this.events.emit(Events2.PlayerRates, this.medias.map((v) => v.definitionDesc + " " + v.definition));
      }
      init() {
        this.httpWorker = new WorkerFactory();
        if (isAudio(this.url)) {
          this.initAudioPlayer();
        } else {
          this.initVideoPlay();
        }
      }
      initVideoPlay() {
        const video = document.createElement("video");
        this.video = video;
        video.src = this.url;
        video.controls = false;
        video.autoplay = false;
        video.style.width = "100%";
        video.style.height = "100%";
        this.onVideoEvents(video);
        video.onerror = (e) => {
          this.initWasmPlay();
        };
        video.oncanplay = (e) => {
          this.events.emit(Events2.PlayerReady, 1);
          video.play().then(() => {
            this.events.emit(Events2.PlayerPlay, 1);
          }).catch((e2) => {
            console.log(e2);
          });
        };
        this.dom.appendChild(video);
      }
      initWasmPlay() {
        this.playType = 1;
        console.log("initWasmPlay");
        this.loadFFmpegWasm();
      }
      onVideoEvents(video) {
        video.addEventListener("timeupdate", (e) => {
          this.events.emit(Events2.PlayerTimeUpdate, {
            current: video.currentTime || 0,
            duration: video.duration || 0
          });
        });
        this.events.on(Events2.PlayerPlay, (e) => {
          if (e) {
            video.play();
          } else {
            video.pause();
          }
        });
        this.events.on(Events2.PlayerSize, (size) => {
          console.log("PlayerSize", size, size / 100);
          video.style.transform = `scale(${size / 100})`;
        });
        this.events.on(Events2.PlayerVolume, (size) => {
          video.volume = Number((size / 100).toFixed(2));
        });
        this.events.on(Events2.PlayerLight, (size) => {
          console.log(size);
        });
        this.events.on(Events2.PlayerGoVip, () => {
          console.log("PlayerGoVip");
          callApp2("xlInvokePayPage");
        });
        this.events.on(Events2.PlayerExit, () => {
          console.log("aa");
          callApp2("xlExitWebPlayer");
        });
      }
      loadVideo(done) {
        this.httpWorker.postMessage({
          type: "invoke",
          method: "fetch",
          name: "data",
          url: this.url
        });
        this.httpWorker.onmessage = (event) => {
          const data = event.data;
          if (data.type === "data") {
            this.videoChunks.push(data.data);
            done && done();
          }
          if (data.type === "notice" && data.name === "speed") {
            console.log("\u5F53\u524D\u901F\u5EA6", data.data);
            this.events.emit(Events2.PlayerSpeed, data.data);
          }
        };
      }
      fetch() {
        return __async$1(this, null, function* () {
          return new Promise((resolve, reject) => {
            this.httpWorker.postMessage({
              type: "invoke",
              method: "fetch",
              name: "data",
              url: this.url
            });
            this.httpWorker.onmessage = (event) => {
              const data = event.data;
              if (data.type === "data") {
                this.videoChunks.push(data.data);
                resolve(data.data);
              }
              if (data.type === "notice" && data.name === "speed") {
                console.log("\u5F53\u524D\u901F\u5EA6", data.data);
                this.events.emit(Events2.PlayerSpeed, data.data);
              }
            };
          });
        });
      }
      loadFFmpegWasm() {
        return __async$1(this, null, function* () {
        });
      }
      initAudioPlayer() {
        const audioNode = document.createElement("audio");
        this.audioNode = audioNode;
        this.dom.appendChild(audioNode);
        this.audioPlayer = new AudioPlayer({
          events: this.events,
          audioNode
        });
        this.loadAudio();
      }
      loadAudio() {
        return __async$1(this, null, function* () {
          const buf = yield this.fetch();
          this.events.on(Events2.AudioPlayerDataReady, () => {
            this.audioPlayer.play();
          });
          this.audioPlayer.feed({
            data_byte: buf,
            duration: 10,
            PTS: 1e3
          });
        });
      }
    }

    var __async$2 = (__this, __arguments, generator) => {
      return new Promise((resolve, reject) => {
        var fulfilled = (value) => {
          try {
            step(generator.next(value));
          } catch (e) {
            reject(e);
          }
        };
        var rejected = (value) => {
          try {
            step(generator.throw(value));
          } catch (e) {
            reject(e);
          }
        };
        var step = (result) => {
          return result.done ? resolve(result.value) : Promise.resolve(result.value).then(fulfilled, rejected);
        };
        step((generator = generator.apply(__this, __arguments)).next());
      });
    };
    function getClientData() {
      return __async$2(this, null, function* () {
        const data = {};
        if (!client2.isNative())
          return data;
        const dataMedia = yield callApp2("xlGetVideoMedias");
        data.title = dataMedia.fileName;
        data.medias = dataMedia.medias;
        const dataLight = yield callApp2("xlGetScreenLight");
        console.log(dataLight);
        data.light = dataLight.light_value;
        const dataCount = yield callApp2("xlGetPlayPrivilegeCfg");
        data.used = dataCount.used_times;
        data.last = dataCount.available_times;
        return data;
      });
    }

    var __async$3 = (__this, __arguments, generator) => {
      return new Promise((resolve, reject) => {
        var fulfilled = (value) => {
          try {
            step(generator.next(value));
          } catch (e) {
            reject(e);
          }
        };
        var rejected = (value) => {
          try {
            step(generator.throw(value));
          } catch (e) {
            reject(e);
          }
        };
        var step = (result) => {
          return result.done ? resolve(result.value) : Promise.resolve(result.value).then(fulfilled, rejected);
        };
        step((generator = generator.apply(__this, __arguments)).next());
      });
    };
    window.addEventListener("DOMContentLoaded", () => __async$3(undefined, null, function* () {
      loadCss("//at.alicdn.com/t/font_2261893_7kfkwop3o9.css");
      ui2("player", events2);
      const data = yield getClientData();
      let url = data.medias ? data.medias[data.medias.length - 1].contentLink : "";
      const player2 = new Player$1({
        url,
        events: events2,
        id: "player",
        data,
        autoplay: true
      });
    }));

})));
